From ca7e005dd121375f847ace0ec468ee09b3a8e6e4 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Thu, 12 Dec 2013 10:31:12 -0600
Subject: [PATCH] install: Fix crash in installation

osTicket configuration is not available while loading initial data
---
 include/class.dept.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/class.dept.php b/include/class.dept.php
index 0822e056f..38b372f8a 100644
--- a/include/class.dept.php
+++ b/include/class.dept.php
@@ -80,7 +80,7 @@ class Dept {
         global $cfg;
 
         if(!$this->email)
-            if(!($this->email = Email::lookup($this->getEmailId())))
+            if(!($this->email = Email::lookup($this->getEmailId())) && $cfg)
                 $this->email = $cfg->getDefaultEmail();
 
         return $this->email;
-- 
GitLab