Skip to content

Commit

Permalink
Fix error on wallet index page
Browse files Browse the repository at this point in the history
  • Loading branch information
timvisee committed Nov 14, 2019
1 parent 6e273e2 commit e858836
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion webapp/app/Models/Economy.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@ public function userHasBalance() {
* @return string Formatted balance
*/
public function formatUserBalance($format = BALANCE_FORMAT_PLAIN) {
return $this->calcUserBalance()->formatAmount($format);
$balance = $this->calcUserBalance();
return $balance != null ? $balance->formatAmount($format) : $balance;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion webapp/resources/views/community/wallet/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
'economyId' => $economy->id,
]) }}" class="item">
{{ $economy->name }}
{!! $economy->formatBalance(BALANCE_FORMAT_LABEL) !!}
{!! $economy->formatUserBalance(BALANCE_FORMAT_LABEL) !!}

<span class="sub-label">
{{ trans_choice('pages.wallets.#wallets', $economy->user_wallet_count) }}
Expand Down

0 comments on commit e858836

Please sign in to comment.