Skip to content

Commit dc129bd

Browse files
committed
check path
1 parent 8385e86 commit dc129bd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Assets/AndroidIl2cppPatchDemo/Editor/AndroidBuilder.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ static bool Exec(string filename, string args)
7575
public static bool ValidateConfig()
7676
{
7777
string sdkPath = EditorPrefs.GetString("AndroidSdkRoot", "");
78-
if (string.IsNullOrEmpty(sdkPath)) { sdkPath = DEFAULT_SDK_PATH; }
78+
if (string.IsNullOrEmpty(sdkPath) || !Directory.Exists(sdkPath)) { sdkPath = DEFAULT_SDK_PATH; }
7979
if (string.IsNullOrEmpty(sdkPath) || !Directory.Exists(sdkPath))
8080
{
8181
Debug.LogError("sdk path is empty! please config via menu path:Edit/Preference->External tools.");
8282
return false;
8383
}
8484

8585
string jdkPath = EditorPrefs.GetString("JdkPath", "");
86-
if (string.IsNullOrEmpty(jdkPath)) { jdkPath = DEFAULT_JDK_PATH; }
86+
if (string.IsNullOrEmpty(jdkPath) || !Directory.Exists(jdkPath)) { jdkPath = DEFAULT_JDK_PATH; }
8787
if (string.IsNullOrEmpty(jdkPath) || !Directory.Exists(jdkPath))
8888
{
8989
Debug.LogError("jdk path is empty! please config via menu path:Edit/Preference->External tools.");
@@ -92,7 +92,7 @@ public static bool ValidateConfig()
9292

9393
string ndkPath = EditorPrefs.GetString("AndroidNdkRootR16b", "");
9494
if (string.IsNullOrEmpty(ndkPath)) { ndkPath = EditorPrefs.GetString("AndroidNdkRoot", ""); }
95-
if (string.IsNullOrEmpty(ndkPath)) { ndkPath = DEFAULT_NDK_PATH; }
95+
if (string.IsNullOrEmpty(ndkPath) || !Directory.Exists(ndkPath)) { ndkPath = DEFAULT_NDK_PATH; }
9696
if (string.IsNullOrEmpty(ndkPath) || !Directory.Exists(ndkPath))
9797
{
9898
Debug.LogError("ndk path is empty! please config via menu path:Edit/Preference->External tools.");
@@ -162,7 +162,7 @@ public static bool ExportGradleProject()
162162
public static bool BuildIl2cppSoLib()
163163
{
164164
string jdkPath = EditorPrefs.GetString("JdkPath", "");
165-
if (string.IsNullOrEmpty(jdkPath)) { jdkPath = DEFAULT_JDK_PATH; }
165+
if (string.IsNullOrEmpty(jdkPath) || !Directory.Exists(jdkPath)) { jdkPath = DEFAULT_JDK_PATH; }
166166
if (string.IsNullOrEmpty(jdkPath) || !Directory.Exists(jdkPath))
167167
{
168168
Debug.LogError("jdk path is empty! please config via menu path:Edit/Preference->External tools.");
@@ -308,7 +308,7 @@ public static bool GenerateBinPatches()
308308
public static bool GenerateBuildScripts()
309309
{
310310
string jdkPath = EditorPrefs.GetString("JdkPath", "");
311-
if (string.IsNullOrEmpty(jdkPath)) { jdkPath = DEFAULT_JDK_PATH; }
311+
if (string.IsNullOrEmpty(jdkPath) || !Directory.Exists(jdkPath)) { jdkPath = DEFAULT_JDK_PATH; }
312312
if (string.IsNullOrEmpty(jdkPath) || !Directory.Exists(jdkPath))
313313
{
314314
Debug.LogError("jdk path is empty! please config via menu path:Edit/Preference->External tools.");

0 commit comments

Comments
 (0)