mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-19 21:57:51 +00:00
Pass undefined directly on data.get when key doesn't exists
To prevent confusing async
This commit is contained in:
parent
a4a9ebf0bb
commit
b0dde8104f
@ -22,7 +22,10 @@ constructPath = (key) ->
|
||||
exports.get = haltIfNoPrefix (key, options, callback) ->
|
||||
exports.has key, (hasKey) ->
|
||||
if not hasKey
|
||||
return callback?(null)
|
||||
|
||||
# Pass undefined explicitly, otherwise
|
||||
# async gets confused
|
||||
return callback?(null, undefined)
|
||||
|
||||
keyPath = constructPath(key)
|
||||
fs.readFile(keyPath, options, callback)
|
||||
|
Loading…
Reference in New Issue
Block a user