react-native-zendesk-chat icon indicating copy to clipboard operation
react-native-zendesk-chat copied to clipboard

Fatal Exception: NSInvalidArgumentException

Open ArtemVass opened this issue 3 years ago • 4 comments

*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0] __33-[RNZendeskChatModule startChat:]_block_invoke

RNZendeskChatModule.m - Line 158 __33-[RNZendeskChatModule startChat:]_block_invoke + 158

iOS 14.4.0 (18D52) iOS 13.4.0 (17E8255) iOS 14.5.0 (18E5164h)

ArtemVass avatar Mar 10 '21 09:03 ArtemVass

Please paste your .startChat call from JS?

fbartho avatar Mar 10 '21 17:03 fbartho

It’s crashing, because ZDKChatEngine is throwing an error, and we’re unfortunately swallowing it.

You can see what error if you manually change this line: https://github.com/taskrabbit/react-native-zendesk-chat/blob/799c8d25fdff5a81b9ee787b14e4b1cc7b4c68df/ios/RNZendeskChatModule.m#L159

- [ZDKChatEngine engineAndReturnError:&error]
+ [ZDKChatEngine engineAndReturnError:&error] ?: NSNull.null

This change will give you a better error log about the true problem

fbartho avatar Mar 10 '21 17:03 fbartho

@fbartho I got this after applying the code

[RNZendeskChatModule] Internal Error loading ZDKChatEngine ChatProvidersSDK.ChatError

rnike avatar Sep 01 '21 07:09 rnike

okay I know why it fails, I haven't init before startChat

rnike avatar Sep 01 '21 07:09 rnike