Check handle before using it
parent
83f4db77e8
commit
42b0a82e3f
|
@ -34,6 +34,10 @@ class Util {
|
||||||
*/
|
*/
|
||||||
public static function getExifFromFile(File &$file) {
|
public static function getExifFromFile(File &$file) {
|
||||||
$handle = $file->fopen('rb');
|
$handle = $file->fopen('rb');
|
||||||
|
if (!$handle) {
|
||||||
|
throw new \Exception('Could not open file');
|
||||||
|
}
|
||||||
|
|
||||||
$exif = self::getExifFromStream($handle);
|
$exif = self::getExifFromStream($handle);
|
||||||
fclose($handle);
|
fclose($handle);
|
||||||
return $exif;
|
return $exif;
|
||||||
|
|
Loading…
Reference in New Issue