Skip to content

Commit

Permalink
Fix updating events
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue authored Apr 7, 2024
1 parent 4f39887 commit 29656a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Versionable.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function (Model $model) {
if (static::$versioning && $model->versions()->count() === 0) {
$existingModel = self::find($model->id);

Version::createForModel($existingModel, $existingModel->only($existingModel->getVersionable()));
$existingModel && Version::createForModel($existingModel, $existingModel->only($existingModel->getVersionable()));
}
}
);
Expand Down

0 comments on commit 29656a8

Please sign in to comment.