Skip to content

Commit 023d816

Browse files
author
Rias
committed
fix #59
1 parent bd41a01 commit 023d816

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to `laravel-db-snapshots` will be documented in this file
44

5+
## 1.2.3 - 2019-06-28
6+
7+
- fix CannotCreateDisk exception when no disks are set up.
8+
59
## 1.2.2 - 2019-06-27
610

711
- fix compression option from config not being respected

src/Exceptions/CannotCreateDisk.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ class CannotCreateDisk extends Exception
88
{
99
public static function diskNotDefined(string $diskName): self
1010
{
11-
$existingDiskNames = implode(array_keys(config('filesystems.disks')), ', ');
11+
$disks = config('filesystems.disks', null);
12+
13+
if (! $disks) {
14+
return new static("Cannot create a disk `{$diskName}`. There are no disks set up.");
15+
}
16+
17+
$existingDiskNames = implode(array_keys($disks), ', ');
1218

1319
return new static("Cannot create a disk `{$diskName}`. Known disknames are {$existingDiskNames}.");
1420
}

0 commit comments

Comments
 (0)