felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r654615 - /felix/trunk/main/src/main/java/org/apache/felix/main/Main.java
Date Thu, 08 May 2008 20:44:22 GMT
Author: rickhall
Date: Thu May  8 13:43:20 2008
New Revision: 654615

URL: http://svn.apache.org/viewvc?rev=654615&view=rev
Log:
Fixed a NPE that was caused when readLine() improperly returned a null.
(FELIX-525)

Modified:
    felix/trunk/main/src/main/java/org/apache/felix/main/Main.java

Modified: felix/trunk/main/src/main/java/org/apache/felix/main/Main.java
URL: http://svn.apache.org/viewvc/felix/trunk/main/src/main/java/org/apache/felix/main/Main.java?rev=654615&r1=654614&r2=654615&view=diff
==============================================================================
--- felix/trunk/main/src/main/java/org/apache/felix/main/Main.java (original)
+++ felix/trunk/main/src/main/java/org/apache/felix/main/Main.java Thu May  8 13:43:20 2008
@@ -202,7 +202,14 @@
                 System.exit(-1);
             }
             System.out.println("");
-            if (profileName.length() != 0)
+
+            // On some platforms readLine() can return null, such as when
+            // control-C is pressed, so check for that case.
+            if (profileName == null)
+            {
+                profileName = "";
+            }
+            else if (profileName.length() != 0)
             {
                 configProps.setProperty(BundleCache.CACHE_PROFILE_PROP, profileName);
             }



Mime
View raw message