diff --git a/include/class.ticket.php b/include/class.ticket.php
index 261bc253ff2e86730f0dd336ce8155dc2b58888b..14e49a9e3bd1bcd17e5ec3a3e82d575c8696ce15 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -722,13 +722,14 @@ class Ticket {
         #     email filter? This method doesn't consider such a case
         if ($trump !== null) {
             $slaId = $trump;
-        } elseif ($this->getDept()->getSLAId()) {
+        } elseif ($this->getDept() && $this->getDept()->getSLAId()) {
             $slaId = $this->getDept()->getSLAId();
-        } elseif ($this->getTopicId() && $this->getTopic()) {
+        } elseif ($this->getTopic() && $this->getTopic()->getSLAId()) {
             $slaId = $this->getTopic()->getSLAId();
         } else {
             $slaId = $cfg->getDefaultSLAId();
         }
+
         return ($slaId && $this->setSLAId($slaId)) ? $slaId : false;
     }