Skip to content

Commit bd8e3e7

Browse files
committed
fix(exporter): validate output dir
1 parent e30bd02 commit bd8e3e7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Exporter.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ public function __destruct()
4242

4343
public function export(string $output, array $options = [])
4444
{
45+
if (!\is_dir(\dirname($output))) {
46+
throw new \InvalidArgumentException('The output path doesnot exist.');
47+
}
48+
4549
$this->setOptions($options);
4650

4751
$this->imgSize = $this->estimateSize($this->code);

0 commit comments

Comments
 (0)