svn commit: r14233 - trunk/src/model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2008-03-27 08:56:25-0700
New Revision: 14233

Modified:
   trunk/src/model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java

Log:
Protect against NPE on null type for TaggedValue

Modified: trunk/src/model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java?view=diff&rev=14233&p1=trunk/src/model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java&p2=trunk/src/model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java&r1=14232&r2=14233
==============================================================================
--- trunk/src/model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java	(original)
+++ trunk/src/model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java	2008-03-27 08:56:25-0700
@@ -1108,10 +1108,10 @@
     public boolean isPrimaryObject(Object handle) {
         try {
             if (handle instanceof ModelElement) {
-                Collection c = ((ModelElement) handle).getTaggedValue();
-                for (Iterator i = c.iterator(); i.hasNext();) {
-                    TaggedValue tv = (TaggedValue) i.next();
-                    if (GENERATED_TAG.equals(tv.getType().getTagType())) {
+                for (TaggedValue tv : ((ModelElement) handle).getTaggedValue()) {
+                    TagDefinition type = tv.getType();
+                    if (type != null 
+                            && GENERATED_TAG.equals(type.getTagType())) {
                         return false;
                     }
                 }
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.