intercom-cordova icon indicating copy to clipboard operation
intercom-cordova copied to clipboard

Handle nil initial message in presentMessageComposer

Open piwel opened this issue 1 month ago • 0 comments

Hi Intercom Cordova team,

We’re seeing a reproducible crash on iOS whenever presentMessageComposer (or the deprecated displayMessageComposer) is invoked without an initial message. The bridge always indexes into command.arguments[0], but when Cordova sends an empty arguments array the call throws NSRangeException:

Fatal Exception: NSRangeException -[IntercomBridge presentMessageComposer:] + IntercomBridge.m:175 -[NSArray objectAtIndexedSubscript:]

Android avoids this by reading args.optString(0), but the iOS bridge doesn’t guard against command.arguments.count == 0 or an NSNull.

This mirrors the Android behavior and prevents the crash for callers that don’t supply an initial message.

piwel avatar Nov 20 '25 16:11 piwel