Skip to content

Commit

Permalink
Fix type check in model name resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
huntie committed May 1, 2017
1 parent 1f7cc75 commit ed4ef14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Http/Controllers/JsonApiController.php
Expand Up @@ -43,7 +43,7 @@ abstract class JsonApiController extends Controller
*/
public function __construct()
{
if (is_string($this->model)) {
if (is_null($this->model) || is_string($this->model)) {
if (!is_subclass_of($this->model, Model::class)) {
$this->model = str_finish(config('jsonapi.model_namespace', app()->getNamespace()), '\\')
. preg_replace('/Controller$/', '', class_basename($this));
Expand Down

0 comments on commit ed4ef14

Please sign in to comment.