fix bug when accessing skinlib without logging in

This commit is contained in:
printempw 2016-07-29 18:53:20 +08:00
parent c6d0f9f6b7
commit 4b54b218d5

View File

@ -39,7 +39,7 @@ class SkinlibController extends BaseController
} elseif ($filter == "user") {
$uid = isset($_GET['uid']) ? $_GET['uid'] : 0;
if ($uid == $this->user->uid) {
if (!is_null($this->user) && $uid == $this->user->uid) {
// show private textures when show uploaded textures of current user
$textures = Texture::where('uploader', $uid)->orderBy($sort_by, 'desc');
$total_pages = ceil($textures->count() / 20);