Fix for models that don't yet exist

Credit to @bennothommo. Fixes https://github.com/octobercms/october/pull/3908#issuecomment-447291101

Co-Authored-By: LukeTowers <github@luketowers.ca>
This commit is contained in:
Ben Thomson 2019-04-12 00:13:39 -06:00 committed by GitHub
parent ab6023f3e9
commit 28ac50ab28
1 changed files with 4 additions and 0 deletions

View File

@ -85,6 +85,10 @@ class AutoDatasource extends Datasource implements DatasourceInterface
*/
public function sourceHasModel(string $source, Model $model)
{
if (!$model->exists) {
return false;
}
$result = false;
$sourcePaths = $this->getSourcePaths($source);