diff --git a/include/class.ticket.php b/include/class.ticket.php
index c8f0d1afd8545b3e4fda99297d569461bbcb4aff..48057249b8c6365fa18e5208f617ca5a4315a3e8 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -1941,10 +1941,11 @@ implements RestrictedAccess, Threadable {
 
         global $thisstaff;
         $data = array();
-        if ($staff->getId() == $thisstaff->getId())
+        if ($thisstaff && $staff->getId() == $thisstaff->getId())
             $data['claim'] = true;
         else
             $data['staff'] = $staff->getId();
+
         $this->logEvent('assigned', $data);
 
         return true;