Skip to content

Commit

Permalink
Fix NPE when local.properties is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
natario1 committed Aug 5, 2024
1 parent 9548868 commit 75dcdf4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 75dcdf4

Please sign in to comment.