Merge branch 'TBSliver/Fix-Undef-Leaderboard' into development
This commit is contained in:
commit
4da2c14066
1 changed files with 2 additions and 1 deletions
|
@ -39,7 +39,8 @@ sub post_index {
|
||||||
|
|
||||||
my $leaderboard_rs = $c->schema->resultset('Leaderboard');
|
my $leaderboard_rs = $c->schema->resultset('Leaderboard');
|
||||||
my $monthly_board = $leaderboard_rs->get_latest( 'monthly_total' );
|
my $monthly_board = $leaderboard_rs->get_latest( 'monthly_total' );
|
||||||
my $current_user_position = $monthly_board->values->find({ user_id => $c->stash->{api_user}->id });
|
my $monthly_values = $monthly_board->values;
|
||||||
|
my $current_user_position = $monthly_values ? $monthly_values->find({ user_id => $c->stash->{api_user}->id }) : undef;
|
||||||
|
|
||||||
return $c->render( json => {
|
return $c->render( json => {
|
||||||
success => Mojo::JSON->true,
|
success => Mojo::JSON->true,
|
||||||
|
|
Reference in a new issue