From 75dcdf4c70972b9695e28b21b00fd295f055ef0c Mon Sep 17 00:00:00 2001 From: Mattia Iavarone Date: Mon, 5 Aug 2024 10:28:58 +0200 Subject: [PATCH] Fix NPE when local.properties is not found --- .../src/main/kotlin/io/deepmedia/tools/deployer/model/Secret.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployer/src/main/kotlin/io/deepmedia/tools/deployer/model/Secret.kt b/deployer/src/main/kotlin/io/deepmedia/tools/deployer/model/Secret.kt index 1953b13..468e571 100644 --- a/deployer/src/main/kotlin/io/deepmedia/tools/deployer/model/Secret.kt +++ b/deployer/src/main/kotlin/io/deepmedia/tools/deployer/model/Secret.kt @@ -32,7 +32,7 @@ private fun findSecret(key: String, providers: ProviderFactory, layout: ProjectL // Try with local.properties file. val dir = layout.projectDirectory.asFile - val local = localPropertiesCache.getOrPut(dir) { dir.localProperties() }?.getProperty(key) + val local = localPropertiesCache.getOrPut(dir) { dir.localProperties() ?: Properties() }?.getProperty(key) if (!local.isNullOrEmpty()) return local // We failed. Return null.