Skip to content

Commit

Permalink
android: fix exception when sending events without URL
Browse files Browse the repository at this point in the history
ENTER_PIP_MODE, for example, does not have it.
  • Loading branch information
saghul committed Jun 21, 2019
1 parent 08c4933 commit 243fdba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public void sendEvent(String name, ReadableMap data, String scope) {
BaseReactView view = BaseReactView.findViewByExternalAPIScope(scope);

if (view != null) {
Log.d(TAG, "Sending event: " + name + " with data: " + data);
try {
view.onExternalAPIEvent(name, data);
} catch(Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ private void setProps(@NonNull Bundle newProps) {
* by/associated with the specified {@code eventName}.
*/
private void maybeSetViewURL(String eventName, ReadableMap eventData) {
String url = eventData.getString("url");
String url = eventData.hasKey("url") ? eventData.getString("url") : null;

switch(eventName) {
case "CONFERENCE_WILL_JOIN":
Expand Down

0 comments on commit 243fdba

Please sign in to comment.