mirror of
https://github.com/snipe/snipe-it.git
synced 2026-03-29 20:04:21 +00:00
Add an early return if the model id is not set (for new Asset Models)
This commit is contained in:
@ -17,6 +17,10 @@ class CustomFieldSetDefaultValuesForModel extends Component
|
||||
|
||||
public function mount()
|
||||
{
|
||||
if(is_null($this->model_id)){
|
||||
return;
|
||||
}
|
||||
|
||||
$this->model = AssetModel::find($this->model_id); // It's possible to do some clever route-model binding here, but let's keep it simple, shall we?
|
||||
$this->fieldset_id = $this->model->fieldset_id;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user