diff --git a/code/model/DMSDocument.php b/code/model/DMSDocument.php index 6954160..7176eab 100644 --- a/code/model/DMSDocument.php +++ b/code/model/DMSDocument.php @@ -1011,9 +1011,11 @@ class DMSDocument extends DataObject implements DMSDocumentInterface $possibleBehaviors = $this->dbObject('DownloadBehavior') ->enumValues(); - $behavior = $possibleBehaviors[$defaultDownloadBehaviour]; - if ($behavior) { - $this->DownloadBehavior = $behavior; + if (array_key_exists($defaultDownloadBehaviour, $possibleBehaviors)) { + $behavior = $possibleBehaviors[$defaultDownloadBehaviour]; + if ($behavior) { + $this->DownloadBehavior = $behavior; + } } } }