Skip to content

Commit

Permalink
Fix NPE when local.properties is not found (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
natario1 authored Aug 5, 2024
1 parent 9548868 commit 469b879
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 469b879

Please sign in to comment.