Skip to content

Conversation

@piwel
Copy link

@piwel piwel commented Nov 20, 2025

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.

 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant