Bug 1039048 - Don't eat IllegalArgumentExceptions in dispatchEvent. r=jchen

This commit is contained in:
Brian Nicholson
2014-07-24 17:55:33 -07:00
parent be937b8b9c
commit c5bff47572

View File

@@ -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);