Skip to content

Commit

Permalink
Protect against NRE.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Jun 28, 2020
1 parent d52690b commit 06ed3b9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/Contents/View.php
Expand Up @@ -93,8 +93,13 @@ public function downloadAttach($id, $zip = false)

$session->close();

$mime = $this->_getRawDownloadPart($id);
$name = $this->_contents->getPartName($mime);
if (!($mime = $this->_getRawDownloadPart($id))) {
return array();
}

if (!($name = $this->_contents->getPartName($mime)) {
$name = '';
}

/* Compress output? */
if ($zip) {
Expand Down

0 comments on commit 06ed3b9

Please sign in to comment.