diff --git a/src/Output/QRImage.php b/src/Output/QRImage.php index 7a5d1cdae..0691d124e 100644 --- a/src/Output/QRImage.php +++ b/src/Output/QRImage.php @@ -166,7 +166,9 @@ class QRImage extends QROutputAbstract{ // if saving to file, append the correct headers if($this->options->cachefile){ - @file_put_contents($this->options->cachefile, '' . "\n" . $imageData); + if(false === @file_put_contents($this->options->cachefile, '' . "\n" . $imageData)){ + throw new QRCodeOutputException('Could not write to cache file.'); + } } if((bool)$this->options->base64){