From 250a974e2d9d2d2dd8dfb8a99b07a77c7e2f637a Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Wed, 27 Feb 2013 23:54:38 +0100 Subject: [PATCH] Fix crash when no action is available. --- JoystickController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JoystickController.m b/JoystickController.m index dfa246f..8b350a4 100644 --- a/JoystickController.m +++ b/JoystickController.m @@ -60,7 +60,7 @@ static void input_callback(void *ctx, IOReturn inResult, void *inSender, IOHIDVa if (((ApplicationController *)[NSApplication sharedApplication].delegate).active) { JSAction *mainAction = [js actionForEvent:value]; [mainAction notifyEvent:value]; - NSArray *children = mainAction.children ? mainAction.children : @[mainAction]; + NSArray *children = mainAction.children ? mainAction.children : mainAction ? @[mainAction] : @[]; for (JSAction *subaction in children) { Target *target = [controller.currentConfig getTargetForAction:subaction]; target.magnitude = mainAction.magnitude; -- 2.30.2