From cd79f44156d48e6cfa6e3d6e1615924f0bb63beb Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Tue, 29 Oct 2013 13:33:49 +0000
Subject: [PATCH] In some edge cases, priority may not be set for a ticket

Fixes #40
---
 include/class.ticket.php | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/include/class.ticket.php b/include/class.ticket.php
index 82cc169a5..4f6548846 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -290,15 +290,16 @@ class Ticket {
     function getPriorityId() {
         global $cfg;
 
-        if ($a = $this->_answers['priority']->getValue())
-            return $a->getId();
+        if (($a = $this->_answers['priority'])
+                && ($b = $a->getValue()))
+            return $b->getId();
         return $cfg->getDefaultPriorityId();
     }
 
     function getPriority() {
-        if ($a = $this->_answers['priority']->getValue())
-            return $a->getDesc();
-        return '...ummm...';
+        if (($a = $this->_answers['priority']) && ($b = $a->getValue()))
+            return $b->getDesc();
+        return '';
     }
 
     function getPhone() {
-- 
GitLab