Skip to content

Commit 178d90a

Browse files
authored
Fix NPE in android_abis.gradle if ANDROID_NDK_HOME is not set (#385)
1 parent bb1640c commit 178d90a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

android_build_files/android_abis.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ android {
2424
// Default list of ABIs available in up-to-date NDK.
2525
abiFilters "x86", "armeabi-v7a", "arm64-v8a", "x86_64"
2626

27-
if (System.getenv("ANDROID_NDK_HOME").contains("r16b") ||
28-
System.getenv("ANDROID_NDK_HOME").contains("r11c")) {
27+
if (System.getenv("ANDROID_NDK_HOME") != null && (
28+
System.getenv("ANDROID_NDK_HOME").contains("r16b") ||
29+
System.getenv("ANDROID_NDK_HOME").contains("r11c"))) {
2930
// Deprecated ABIs are added to the list when building using older NDKs only.
3031
// Rather than an exhaustive list, we only support r11c and r16b.
3132
abiFilters.add("armeabi")

0 commit comments

Comments
 (0)