svn commit: r14006 - trunk/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2007-12-27 10:54:39-0800
New Revision: 14006

Modified:
   trunk/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java

Log:
Fix NullPointerException when FigStereotype contains a keyword like <<interface>>

Modified: trunk/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java?view=diff&rev=14006&p1=trunk/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java&p2=trunk/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java&r1=14005&r2=14006
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java	(original)
+++ trunk/src_new/org/argouml/uml/diagram/ui/FigStereotypesCompartment.java	2007-12-27 10:54:39-0800
@@ -316,8 +316,15 @@
             LOG.warn("getProject() returned null");
             return null;
         }
-        return project.getProfileConfiguration().getFigNodeStrategy()
-                .getIconForStereotype(fs.getOwner());
+        Object owner = fs.getOwner();
+        if (owner == null) {
+            // keywords which look like a stereotype (e.g. <<interface>>) have
+            // no owner
+            return null;
+        } else {
+            return project.getProfileConfiguration().getFigNodeStrategy()
+                    .getIconForStereotype(owner);
+        }
     }
 
     /*
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.