mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2025-03-29 06:17:46 +01:00
Fixed error for unpublished tracks
This commit is contained in:
parent
ccb92606e8
commit
7b4cf4adff
1 changed files with 5 additions and 0 deletions
|
@ -146,6 +146,11 @@ class StatsController extends ApiControllerBase
|
||||||
$now = Carbon::now();
|
$now = Carbon::now();
|
||||||
$trackDate = $track->published_at;
|
$trackDate = $track->published_at;
|
||||||
|
|
||||||
|
// Error catching for tracks that don't exist anymore
|
||||||
|
// or are not published
|
||||||
|
if ($trackDate == null)
|
||||||
|
return $this->notFound('Track not found!');
|
||||||
|
|
||||||
if ($trackDate->diffInDays($now) >= 1)
|
if ($trackDate->diffInDays($now) >= 1)
|
||||||
return $this->getTrackStatsDaily($id);
|
return $this->getTrackStatsDaily($id);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue