OSDN Git Service

Fix 'android create test-project' to handle parent projects with missing default...
authorXavier Ducrohet <xav@android.com>
Mon, 1 Feb 2010 23:12:56 +0000 (15:12 -0800)
committerXavier Ducrohet <xav@android.com>
Mon, 1 Feb 2010 23:12:56 +0000 (15:12 -0800)
Bug: 2411562
Change-Id: Ia22491d56dfa3c5dda700782c28a2bcbfeebd266

sdkmanager/app/src/com/android/sdkmanager/Main.java

index 8084693..7f49ea3 100644 (file)
@@ -414,6 +414,12 @@ public class Main {
         // now get the target hash
         ProjectProperties p = ProjectProperties.load(parentProject.getAbsolutePath(),
                 PropertyType.DEFAULT);
+        if (p == null) {
+            errorAndExit("Unable to load the main project's %1$s",
+                    PropertyType.DEFAULT.getFilename());
+            return;
+        }
+
         String targetHash = p.getProperty(ProjectProperties.PROPERTY_TARGET);
         if (targetHash == null) {
             errorAndExit("Couldn't find the main project target");
@@ -511,7 +517,7 @@ public class Main {
         }
 
         if (couldHaveDone) {
-            mSdkLog.printf("It seems that there are sub-projects. If you want to update them\nplease use the --%1$s parameter.",
+            mSdkLog.printf("It seems that there are sub-projects. If you want to update them\nplease use the --%1$s parameter.\n",
                     SdkCommandLine.KEY_SUBPROJECTS);
         }
     }