Skip to content

Commit 8cf3bfc

Browse files
committed
fix: make sure ANDROID_HOME is valid before using
1 parent ce71ae7 commit 8cf3bfc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

devices/android.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ func (d *AndroidDevice) State() string {
5959
func getAndroidSdkPath() string {
6060
sdkPath := os.Getenv("ANDROID_HOME")
6161
if sdkPath != "" {
62-
return sdkPath
62+
if _, err := os.Stat(sdkPath); err == nil {
63+
return sdkPath
64+
}
6365
}
6466

6567
// try default Android SDK location on macOS

0 commit comments

Comments
 (0)