mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 03:52:14 +00:00
fix(unlocks): Handle undefined/null balance
This commit is contained in:
parent
6e27b7af9d
commit
84b333e5c1
1 changed files with 1 additions and 1 deletions
|
|
@ -892,7 +892,7 @@ api.wrap = (user, main=true) ->
|
|||
else
|
||||
if fullSet then 1.25 else 0.5
|
||||
alreadyOwns = !fullSet and user.fns.dotGet("purchased." + path) is true
|
||||
return cb?({code:401, message: i18n.t('notEnoughGems', req.language)}) if user.balance < cost and !alreadyOwns
|
||||
return cb?({code:401, message: i18n.t('notEnoughGems', req.language)}) if (user.balance < cost or !user.balance) and !alreadyOwns
|
||||
if fullSet
|
||||
_.each path.split(","), (p) ->
|
||||
if ~path.indexOf('gear.')
|
||||
|
|
|
|||
Loading…
Reference in a new issue