directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r588539 - /directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractEclipseJob.java
Date Fri, 26 Oct 2007 06:39:56 GMT
Author: seelmann
Date: Thu Oct 25 23:39:53 2007
New Revision: 588539

URL: http://svn.apache.org/viewvc?rev=588539&view=rev
Log:
Fixed potential NPE when running jobs.

Modified:
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractEclipseJob.java

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractEclipseJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractEclipseJob.java?rev=588539&r1=588538&r2=588539&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractEclipseJob.java
(original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/AbstractEclipseJob.java
Thu Oct 25 23:39:53 2007
@@ -149,6 +149,18 @@
 
     public final void execute()
     {
+        // prevent from running the job if there are no connections 
+        Connection[] connections = getConnections();
+        for ( Connection connection : connections )
+        {
+            if(connection == null)
+            {
+                // TODO: logger
+                System.out.println( "Null connection: " + this.getClass().getName() );
+                return;
+            }
+        }
+        
         setUser( true );
         schedule();
     }



Mime
View raw message