logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r954702 - /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java
Date Tue, 15 Jun 2010 04:18:29 GMT
Author: sdeboy
Date: Tue Jun 15 04:18:28 2010
New Revision: 954702

URL: http://svn.apache.org/viewvc?rev=954702&view=rev
Log:
Prevent possible NPE on mouseover when the thumbnail bar has no colored entries

Modified:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java?rev=954702&r1=954701&r2=954702&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java Tue Jun 15
04:18:28 2010
@@ -3199,7 +3199,9 @@ public class LogPanel extends DockablePa
                 if (preferenceModel.isThumbnailBarToolTips()) {
                     int yPosition = e.getPoint().y;
                     EventWrapper event = getEventWrapperAtPosition(yPosition);
-                    setToolTipText(getToolTipTextForEvent(event.loggingEvent));
+                    if (event != null) {
+                        setToolTipText(getToolTipTextForEvent(event.loggingEvent));
+                    }
                 } else {
                     setToolTipText(null);
                 }
@@ -3315,6 +3317,11 @@ public class LogPanel extends DockablePa
             });
         }
 
+        /**
+         * Get event wrapper - may be null
+         * @param yPosition
+         * @return event wrapper or null
+         */
         private EventWrapper getEventWrapperAtPosition(int yPosition)
         {
             int rowCount = table.getRowCount();



Mime
View raw message