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