OSDN Git Service

Fix NPE in the parsing of property file.
authorXavier Ducrohet <xav@android.com>
Tue, 13 Oct 2009 17:28:16 +0000 (10:28 -0700)
committerXavier Ducrohet <xav@android.com>
Tue, 13 Oct 2009 17:28:16 +0000 (10:28 -0700)
this could happen if the log object is null and the parsing fails.

Change-Id: I6dbcafab26c5405efba20b30f511104fcee5bf78

tools/sdkmanager/libs/sdklib/src/com/android/sdklib/SdkManager.java

index 7b47f4a..9009274 100644 (file)
@@ -605,8 +605,10 @@ public final class SdkManager {
                     if (m.matches()) {
                         map.put(m.group(1), m.group(2));
                     } else {
-                        log.warning("Error parsing '%1$s': \"%2$s\" is not a valid syntax",
-                                buildProp.getAbsolutePath(), line);
+                        if (log != null) {
+                            log.warning("Error parsing '%1$s': \"%2$s\" is not a valid syntax",
+                                    buildProp.getAbsolutePath(), line);
+                        }
                         return null;
                     }
                 }