baker icon indicating copy to clipboard operation
baker copied to clipboard

App Crash - Newsstand App

Open davidrsim opened this issue 13 years ago • 3 comments

Hi,

I'm struggling a little bit with a Newsstand app. It seems to download the hpub fine and runs through the book.json. I've checked it on JSONLint and there's no errors reported.

The app is crashing and I'm struggling to identify the cause:

2013-03-15 17:13:58.190 Baker[77877:c07] Refreshing magazine-summer view with status downloaded 2013-03-15 17:13:58.193 Baker[77877:c07] Validating book JSON param "url" 2013-03-15 17:13:58.194 Baker[77877:c07] Validating book JSON param "-baker-rendering" 2013-03-15 17:13:58.195 Baker[77877:c07] Validating book JSON param "cover" 2013-03-15 17:13:58.197 Baker[77877:c07] Validating book JSON param "contents" 2013-03-15 17:13:58.198 Baker[77877:c07] Validating book JSON param "-baker-vertical-pagination" 2013-03-15 17:13:58.198 Baker[77877:c07] Validating book JSON param "author" 2013-03-15 17:13:58.198 Baker[77877:c07] Validating book JSON param "orientation" 2013-03-15 17:13:58.199 Baker[77877:c07] Validating book JSON param "title" 2013-03-15 17:13:58.276 Baker[77877:c07] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]' *** First throw call stack: (0x1d02012 0x16afe7e 0x1cb70e4 0x1cd9289 0x5cab9 0x5c3b6 0x5c32b 0x5c1e5 0x68afa 0xf4876c 0xeb4652 0xf45bb0 0xf49f46 0xf4a138 0x1c85f3f 0x1c8596f 0x1ca8734 0x1ca7f44 0x1ca7e1b 0x29967e3 0x2996668 0x2f4ffc 0x2612 0x2545) libc++abi.dylib: terminate called throwing an exception (lldb)

Any ideas?

Thanks, David.

davidrsim avatar Mar 15 '13 17:03 davidrsim

The log suggests to me that you may have some issue with the list of pages. Have you looked into that already?

Simbul avatar Mar 18 '13 08:03 Simbul

I traced the problem. The book.json has to have a "creator". If it doesn't it crashes at:

BakerBook.m:

if ([[bookData objectForKey:@"creator"] isKindOfClass:[NSArray class]]) { self.creator = [bookData objectForKey:@"creator"]; } else { self.creator = [NSArray arrayWithObject:[bookData objectForKey:@"creator"]]; }

davidrsim avatar Mar 18 '13 14:03 davidrsim

I was able to reproduce it, and this is definitely a bug, as creator is not among the mandatory parameters. We'll work on a fix, thanks for the investigation :+1:

Simbul avatar Mar 18 '13 22:03 Simbul