directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1440877 - /directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorOutlinePage.java
Date Thu, 31 Jan 2013 08:29:35 GMT
Author: pamarcelot
Date: Thu Jan 31 08:29:35 2013
New Revision: 1440877

URL: http://svn.apache.org/viewvc?rev=1440877&view=rev
Log:
Fixed a potential NPE.

Modified:
    directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorOutlinePage.java

Modified: directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorOutlinePage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorOutlinePage.java?rev=1440877&r1=1440876&r2=1440877&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorOutlinePage.java
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/entry/EntryEditorOutlinePage.java
Thu Jan 31 08:29:35 2013
@@ -215,21 +215,39 @@ public class EntryEditorOutlinePage exte
      */
     public void refresh()
     {
+        TreeViewer treeViewer = getTreeViewer();
+
         if ( hasAnOutline() )
         {
-            getTreeViewer().getControl().setParent( composite );
+            if ( treeViewer != null )
+            {
+                Control treeViewerControl = treeViewer.getControl();
+
+                if ( ( treeViewerControl != null ) && ( !treeViewerControl.isDisposed()
) )
+                {
+                    treeViewerControl.setParent( composite );
+                }
+            }
+
             noOutlineComposite.setParent( fakeComposite );
         }
         else
         {
-            getTreeViewer().getControl().setParent( fakeComposite );
+            if ( treeViewer != null )
+            {
+                Control treeViewerControl = treeViewer.getControl();
+
+                if ( ( treeViewerControl != null ) && ( !treeViewerControl.isDisposed()
) )
+                {
+                    treeViewerControl.setParent( fakeComposite );
+                }
+            }
+
             noOutlineComposite.setParent( composite );
         }
 
         composite.layout();
 
-        final TreeViewer treeViewer = getTreeViewer();
-
         if ( treeViewer != null && treeViewer.getTree() != null && !treeViewer.getTree().isDisposed()
)
         {
             treeViewer.setFilters( entryEditor.getMainWidget().getViewer().getFilters() );
@@ -511,6 +529,6 @@ public class EntryEditorOutlinePage exte
     {
         Object o = entryEditor.getMainWidget().getViewer().getInput();
 
-        return ( o != null && o instanceof IEntry );
+        return ( ( o != null ) && ( o instanceof IEntry ) );
     }
 }



Mime
View raw message