Skip to content

Commit 4e7ee37

Browse files
authored
Fixed bug that restart failed when don't have .env. (#6949)
1 parent 5fd26c9 commit 4e7ee37

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Listener/ReloadDotenvListener.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ public function process(object $event): void
3535
$this->reloadDotenv();
3636
}
3737

38-
protected function reloadDotenv(): void
38+
private function reloadDotenv(): void
3939
{
40-
DotenvManager::reload([BASE_PATH]);
40+
if (file_exists(BASE_PATH . '/.env')) {
41+
DotenvManager::reload([BASE_PATH]);
42+
}
4143
}
4244
}

0 commit comments

Comments
 (0)