dbukowski/DBDebugToolkit

response body page crash in some request

jahov0820 opened this issue · 6 comments

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'data parameter is nil'

Hello @liaojiahao!
Thank you for reporting this issue and sorry for responding so late. Could you give me more details about this issue? Which method has nil data parameter?

Closing the issue due to the lack of response. If that problem reoccurs in the newer versions, please use Crash Reports included in the library to provide more details.

Hi, I've gotten crash in DBBodyPreviewViewController configureWithRequestModel. For me, data parameter to the block was nil. It looks like it can also crash if JSONObjectWithData fails and returns nil (and also if dataWithJSONObject ever returns nil, but that might not happen realistically).

Also, it might be nice to have a fallback that displays a hex dump for when image or UTF8 decoding fails.

Hi, thanks for reporting that! I’ll make sure to investigate it after my holidays in around 2 weeks.

pyrou commented

Same here

Should be fixed now in 0.5.1 - I added handling nil data. Also, as you suggested, if UTF8 decoding fails, the data will be displayed in hex. Thanks!