From: Joe Wreschnig Date: Wed, 27 Feb 2013 22:54:38 +0000 (+0100) Subject: Fix crash when no action is available. X-Git-Tag: version-1.0~106 X-Git-Url: https://git.yukkurigames.com/?a=commitdiff_plain;h=250a974e2d9d2d2dd8dfb8a99b07a77c7e2f637a;p=enjoyable.git Fix crash when no action is available. --- 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;