Fixed a null pointer exception.

This commit is contained in:
James Cole 2015-08-09 13:54:58 +02:00
parent 3424e019b5
commit 8d109a3cfe

View File

@ -190,7 +190,8 @@ class TagController extends Controller
$tags = Auth::user()->tags()->where('tagMode', $type)->orderBy('date', 'ASC')->get();
$tags = $tags->sortBy(
function (Tag $tag) {
$date = $tag->date->format('Ymd');
$date = !is_null($tag->date) ? $tag->date->format('Ymd') : '000000';
return strtolower($date . $tag->tag);
}