Bug 1039048 - Don't eat IllegalArgumentExceptions in dispatchEvent. r=jchen
This commit is contained in:
@@ -140,8 +140,6 @@ public final class EventDispatcher {
|
||||
}
|
||||
|
||||
public void dispatchEvent(final NativeJSContainer message) {
|
||||
EventCallback callback = null;
|
||||
try {
|
||||
// First try native listeners.
|
||||
final String type = message.getString("type");
|
||||
|
||||
@@ -151,6 +149,7 @@ public final class EventDispatcher {
|
||||
}
|
||||
|
||||
final String guid = message.optString(GUID, null);
|
||||
EventCallback callback = null;
|
||||
if (guid != null) {
|
||||
callback = new GeckoEventCallback(guid, type);
|
||||
}
|
||||
@@ -166,9 +165,7 @@ public final class EventDispatcher {
|
||||
// and return early. This assumption is checked when registering listeners.
|
||||
return;
|
||||
}
|
||||
} catch (final IllegalArgumentException e) {
|
||||
// Message doesn't have a "type" property, fallback to JSON
|
||||
}
|
||||
|
||||
try {
|
||||
// If we didn't find native listeners, try JSON listeners.
|
||||
dispatchEvent(new JSONObject(message.toString()), callback);
|
||||
|
||||
Reference in New Issue
Block a user