Skip to content

Commit

Permalink
Exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
daftspunk committed Mar 3, 2022
1 parent eeb950b commit 05af6fa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Resize/Resizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ public function __construct($file)
exit(1);
}

if (!$file) {
throw new Exception('Opened resizer on an empty file');
}

if (is_string($file)) {
$file = new FileObj($file);
}
Expand Down

0 comments on commit 05af6fa

Please sign in to comment.