Author: tfmorris
Date: 2008-10-06 08:46:52-0700
New Revision: 15887

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/ui/UMLTreeCellRenderer.java

Log:
Issue 5438: avoid IllegalArgumentExceptions during delete
http://argouml.tigris.org/issues/show_bug.cgi?id=5438

Modified: trunk/src/argouml-app/src/org/argouml/uml/ui/UMLTreeCellRenderer.java
Url: 
http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/UMLTreeCellRenderer.java?view=diff&rev=15887&p1=trunk/src/argouml-app/src/org/argouml/uml/ui/UMLTreeCellRenderer.java&p2=trunk/src/argouml-app/src/org/argouml/uml/ui/UMLTreeCellRenderer.java&r1=15886&r2=15887
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/ui/UMLTreeCellRenderer.java       
(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/UMLTreeCellRenderer.java       
2008-10-06 08:46:52-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-2008 The Regents of the University of California. All
 // Rights Reserved. Permission to use, copy, modify, and distribute this
 // software and its documentation without fee, and without a written
 // agreement is hereby granted, provided that the above copyright notice
@@ -61,6 +61,7 @@
      *      javax.swing.JTree, java.lang.Object, boolean, boolean, boolean, 
int,
      *      boolean)
      */
+    @Override
     public Component getTreeCellRendererComponent(
         JTree tree,
         Object value,
@@ -84,7 +85,7 @@
                 row,
                 hasFocusParam);
 
-        if (r instanceof JLabel) {
+        if (value != null && r instanceof JLabel) {
             JLabel lab = (JLabel) r;
 
             // setting the icon
@@ -119,4 +120,4 @@
         return r;
     }
 
-} /* end class UMLTreeCellRenderer */
+}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to