check data of closet valid before loop

This commit is contained in:
printempw 2016-12-16 22:51:50 +08:00
parent 139db5c08d
commit 56cefa1ca5

View File

@ -63,7 +63,7 @@ class Closet
// load items from json string
$this->textures = json_decode($this->db->where('uid', $uid)->get()[0]->textures, true);
$this->textures = is_null($this->textures) ? [] : $this->textures;
$this->textures = is_array($this->textures) ? $this->textures : [];
$textures_invalid = [];