directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1066897 - /directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/views/ProblemsViewLabelProvider.java
Date Thu, 03 Feb 2011 17:52:08 GMT
Author: pamarcelot
Date: Thu Feb  3 17:52:07 2011
New Revision: 1066897

URL: http://svn.apache.org/viewvc?rev=1066897&view=rev
Log:
Preventing NPEs.

Modified:
    directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/views/ProblemsViewLabelProvider.java

Modified: directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/views/ProblemsViewLabelProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/views/ProblemsViewLabelProvider.java?rev=1066897&r1=1066896&r2=1066897&view=diff
==============================================================================
--- directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/views/ProblemsViewLabelProvider.java
(original)
+++ directory/studio/trunk/plugins/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/views/ProblemsViewLabelProvider.java
Thu Feb  3 17:52:07 2011
@@ -449,16 +449,28 @@ public class ProblemsViewLabelProvider e
      */
     private String getDisplayName( SchemaObject so )
     {
-        SchemaObject schemaObject = getSchemaObject( so );
-        String name = schemaObject.getName();
-        if ( ( name != null ) && ( !name.equals( "" ) ) ) //$NON-NLS-1$
+        if ( so != null )
         {
-            return name;
-        }
-        else
-        {
-            return so.getOid();
+            SchemaObject schemaObject = getSchemaObject( so );
+            if ( schemaObject != null )
+            {
+                String name = schemaObject.getName();
+                if ( ( name != null ) && ( !name.equals( "" ) ) ) // $NON-NLS-1$
+                {
+                    return name;
+                }
+                else
+                {
+                    return so.getOid();
+                }
+            }
+            else
+            {
+                return so.getOid();
+            }
         }
+
+        return ""; // $NON-NLS-1$
     }
 
 



Mime
View raw message