android: fix exception when sending events without URL

ENTER_PIP_MODE, for example, does not have it.
This commit is contained in:
Saúl Ibarra Corretgé 2019-06-20 22:18:09 +02:00 committed by Saúl Ibarra Corretgé
parent 08c4933c1b
commit 243fdba80f
2 changed files with 2 additions and 1 deletions

View File

@ -73,6 +73,7 @@ class ExternalAPIModule
BaseReactView view = BaseReactView.findViewByExternalAPIScope(scope); BaseReactView view = BaseReactView.findViewByExternalAPIScope(scope);
if (view != null) { if (view != null) {
Log.d(TAG, "Sending event: " + name + " with data: " + data);
try { try {
view.onExternalAPIEvent(name, data); view.onExternalAPIEvent(name, data);
} catch(Exception e) { } catch(Exception e) {

View File

@ -181,7 +181,7 @@ public class JitsiMeetView extends BaseReactView<JitsiMeetViewListener> {
* by/associated with the specified {@code eventName}. * by/associated with the specified {@code eventName}.
*/ */
private void maybeSetViewURL(String eventName, ReadableMap eventData) { private void maybeSetViewURL(String eventName, ReadableMap eventData) {
String url = eventData.getString("url"); String url = eventData.hasKey("url") ? eventData.getString("url") : null;
switch(eventName) { switch(eventName) {
case "CONFERENCE_WILL_JOIN": case "CONFERENCE_WILL_JOIN":