Skip to content

Commit

Permalink
ImageStorage: Storage path can not be null.
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek authored Oct 16, 2021
1 parent 37b0780 commit 704ac4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ImageStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public function __construct(?string $storagePath = null, string $relativeStorage
$relativeStoragePath = 'wordpress-post-feed';
}
if ($storagePath === null && isset($_SERVER['SCRIPT_FILENAME'])) {
$storagePath = dirname((string) $_SERVER['SCRIPT_FILENAME']) . DIRECTORY_SEPARATOR . $relativeStoragePath;
} else {
$storagePath = dirname($_SERVER['SCRIPT_FILENAME']) . DIRECTORY_SEPARATOR . $relativeStoragePath;
} elseif ($storagePath === null) {
throw new \RuntimeException('Script filename is not available. Please define storagePath manually.');
}
$this->storagePath = $storagePath;
Expand Down

0 comments on commit 704ac4f

Please sign in to comment.