From 2eec8676fee893e355f5b5f9539d981f125f7086 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Tue, 10 Dec 2019 19:50:20 +0100 Subject: [PATCH] Add try catch block for _getMediaInfo function --- .../processing/post/ProcessAdditional.php | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/Blacklight/processing/post/ProcessAdditional.php b/Blacklight/processing/post/ProcessAdditional.php index 448a7257c..5b1d4767f 100755 --- a/Blacklight/processing/post/ProcessAdditional.php +++ b/Blacklight/processing/post/ProcessAdditional.php @@ -2084,23 +2084,28 @@ class ProcessAdditional // Look for the video file. if (File::isFile($fileLocation)) { - $xmlArray = $this->mediaInfo->getInfo($fileLocation, false); + try { + $xmlArray = $this->mediaInfo->getInfo($fileLocation, false); - // Check if we got it. + // Check if we got it. - if ($xmlArray === null) { + if ($xmlArray === null) { + return false; + } + + // Insert it into the DB. + $this->_releaseExtra->addFull($this->_release->id, $xmlArray); + $this->_releaseExtra->addFromXml($this->_release->id, $xmlArray); + + if ($this->_echoCLI) { + $this->_echo('m', 'primaryOver'); + } + + return true; + } catch (\RuntimeException $e) { + Log::debug($e->getMessage()); return false; } - - // Insert it into the DB. - $this->_releaseExtra->addFull($this->_release->id, $xmlArray); - $this->_releaseExtra->addFromXml($this->_release->id, $xmlArray); - - if ($this->_echoCLI) { - $this->_echo('m', 'primaryOver'); - } - - return true; } return false;