Reveal 2 RevealServer crash if CFBundleShortVersionString or CFBundleVersion are empty

RevealServer in Reveal 2 will crash if CFBundleShortVersionString or CFBundleVersion is nil or empty in your application's Info.plist

The crash looks like this:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[10]' 
*** First throw call stack: 
0 CoreFoundation 0x057eb494 __exceptionPreprocess + 180 
1 libobjc.A.dylib 0x052a5e02 objc_exception_throw + 50 
2 CoreFoundation 0x056d26d2 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 386
3 CoreFoundation 0x056e695b +[NSDictionary dictionaryWithObjects:forKeys:count:] + 75 
4 RevealServer 0x020d3104 -[IBARevealServer start:] + 2413 
5 RevealServer 0x020b7dfb +[IBARevealLoader startServer] + 173 
6 RevealServer 0x020b82f6 __23+[IBARevealLoader load]_block_invoke_2 + 32 
7 RevealServer 0x020f0849 -[IBAApplicationStateTrackerg; notifyDidBecomeActive] + 86 
8 Foundation 0x04bb1b86 __57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_2 + 40

This can happen if you have a script to inject these version numbers during the build but that script is not run in debug/development builds.

You can test if this is a problem in your application by putting a symbolic breakpoint on UIApplicationMainand then in the LLDB command console typing the following commands:

po [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]
po [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]

If either of these expressions returns nil RevealServer will crash on startup.

This bug has been fully resolved in Reveal 6.