Skip to content

Commit

Permalink
Only do JSON check if there is actual data
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdekruijk committed May 1, 2020
1 parent 45a9025 commit 700ffa7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Controllers/ModelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ private function save($model, Request $request)
$row[$column['model']][$key][$columnId2] = $value;
}
}
} elseif (isset($column['type']) && $column['type'] == 'array') {
} elseif (isset($column['type']) && $column['type'] == 'array' && $request[$columnId]) {
// If column is of type array json decode it
$model[$columnId] = json_decode($request[$columnId], true);
// If the JSON input is invalid return a 422 validation error
Expand Down

0 comments on commit 700ffa7

Please sign in to comment.