X-Git-Url: https://git.yukkurigames.com/?a=blobdiff_plain;f=JoystickController.m;h=8b350a489788f25f33373a7cf4cc0e168a7b1b55;hb=3a40cba25b9bb38887fe4809277d4c0f73462d12;hp=dfa246f6f622b909407153c735f00225d5bdd34a;hpb=51d43664909060e85c943c4d63cc3cff307ceb1d;p=enjoyable.git 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;