From b5fc0f19f23a7725602723b4c302d4b9f095a309 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Mon, 7 Aug 2023 16:53:51 +0300 Subject: [PATCH] Proper fix for Android launcher nullptr dereference --- android/vcmi-app/src/main/java/eu/vcmi/vcmi/util/FileUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/vcmi-app/src/main/java/eu/vcmi/vcmi/util/FileUtil.java b/android/vcmi-app/src/main/java/eu/vcmi/vcmi/util/FileUtil.java index 49b731425..887c8ba9c 100644 --- a/android/vcmi-app/src/main/java/eu/vcmi/vcmi/util/FileUtil.java +++ b/android/vcmi-app/src/main/java/eu/vcmi/vcmi/util/FileUtil.java @@ -99,7 +99,7 @@ public class FileUtil public static boolean clearDirectory(final File dir) { - if (dir == null) + if (dir == null || dir.listFiles() == null) { Log.e("Broken path given to fileutil::clearDirectory"); return false;