Author: [EMAIL PROTECTED]
Date: Tue Nov 11 10:43:20 2008
New Revision: 4017

Modified:
     
branches/1_6_clean_events/user/src/com/google/gwt/event/dom/client/DomEvent.java

Log:
Fix NPE in DomEvent#fireNativeEvent, reviewed by ecc

Modified:  
branches/1_6_clean_events/user/src/com/google/gwt/event/dom/client/DomEvent.java
==============================================================================
---  
branches/1_6_clean_events/user/src/com/google/gwt/event/dom/client/DomEvent.java
         
(original)
+++  
branches/1_6_clean_events/user/src/com/google/gwt/event/dom/client/DomEvent.java
         
Tue Nov 11 10:43:20 2008
@@ -109,12 +109,14 @@
     * Fires the given native event on the specified handlers.
     *
     * @param nativeEvent the native event
-   * @param handlers the event manager containing the handlers to fire
+   * @param handlers the event manager containing the handlers to fire  
(may be
+   *          null)
     */
    public static void fireNativeEvent(Event nativeEvent, HandlerManager  
handlers) {
-    if (registered != null) {
+    assert nativeEvent != null : "nativeEvent must not be null";
+    if (registered != null && handlers != null) {
        final DomEvent.Type<?> typeKey =  
registered.unsafeGet(nativeEvent.getType());
-      if (handlers != null) {
+      if (typeKey != null) {
          // Store and restore native event just in case we are in recursive
          // loop.
          Event currentNative = typeKey.flyweight.nativeEvent;

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to