From 0a7c91eeb850b32e42c83a634692ad22ea0e6c62 Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Thu, 12 Dec 2024 17:00:41 +0100 Subject: [PATCH] address comment --- .../lib/src/code_assets/validation.dart | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/pkgs/native_assets_cli/lib/src/code_assets/validation.dart b/pkgs/native_assets_cli/lib/src/code_assets/validation.dart index 59fb4f3f9..40b17f8ec 100644 --- a/pkgs/native_assets_cli/lib/src/code_assets/validation.dart +++ b/pkgs/native_assets_cli/lib/src/code_assets/validation.dart @@ -53,21 +53,24 @@ ValidationErrors _validateCodeConfig( break; } final compilerConfig = codeConfig.cCompiler; - final compiler = compilerConfig?.compiler.toFilePath(); - if (compiler != null && !File(compiler).existsSync()) { - errors.add('$configName.codeConfig.compiler ($compiler) does not exist.'); - } - final linker = compilerConfig?.linker.toFilePath(); - if (linker != null && !File(linker).existsSync()) { - errors.add('$configName.codeConfig.linker ($linker) does not exist.'); - } - final archiver = compilerConfig?.archiver.toFilePath(); - if (archiver != null && !File(archiver).existsSync()) { - errors.add('$configName.codeConfig.archiver ($archiver) does not exist.'); - } - final envScript = compilerConfig?.envScript?.toFilePath(); - if (envScript != null && !File(envScript).existsSync()) { - errors.add('$configName.codeConfig.envScript ($envScript) does not exist.'); + if (compilerConfig != null) { + final compiler = compilerConfig.compiler.toFilePath(); + if (!File(compiler).existsSync()) { + errors.add('$configName.codeConfig.compiler ($compiler) does not exist.'); + } + final linker = compilerConfig.linker.toFilePath(); + if (!File(linker).existsSync()) { + errors.add('$configName.codeConfig.linker ($linker) does not exist.'); + } + final archiver = compilerConfig.archiver.toFilePath(); + if (!File(archiver).existsSync()) { + errors.add('$configName.codeConfig.archiver ($archiver) does not exist.'); + } + final envScript = compilerConfig.envScript?.toFilePath(); + if (envScript != null && !File(envScript).existsSync()) { + errors + .add('$configName.codeConfig.envScript ($envScript) does not exist.'); + } } return errors; }