From 51603695f4ecad17706772f07af3212cd46dbdc3 Mon Sep 17 00:00:00 2001 From: Ulugbek Date: Sat, 9 Jul 2022 15:58:59 +0200 Subject: [PATCH] TeaVMTool: handle target directory creation error --- tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java b/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java index a46290d23..f1c51330e 100644 --- a/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java +++ b/tools/core/src/main/java/org/teavm/tooling/TeaVMTool.java @@ -436,7 +436,11 @@ public class TeaVMTool { for (String className : classesToPreserve) { vm.preserveType(className); } - targetDirectory.mkdirs(); + + if (!targetDirectory.mkdirs()) { + log.error("Target directory could not be created"); + return; + } BuildTarget buildTarget = new DirectoryBuildTarget(targetDirectory); String outputName = getResolvedTargetFileName();