From 0d8ef81ec2f2e1ddbab9da906f2537255fce396d Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Fri, 09 Aug 2013 07:08:05 -0400
Subject: [PATCH] - Added check that $app->modules->current_datalog_id is set and > 0.

---
 server/lib/classes/db_mysql.inc.php |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/server/lib/classes/db_mysql.inc.php b/server/lib/classes/db_mysql.inc.php
index 039b427..23ba8a6 100644
--- a/server/lib/classes/db_mysql.inc.php
+++ b/server/lib/classes/db_mysql.inc.php
@@ -378,7 +378,7 @@
     public function datalogError($errormsg) {
       global $app;
 	  
-	  $this->query("UPDATE sys_datalog set error = '".$this->quote($errormsg)."' WHERE datalog_id = ".$app->modules->current_datalog_id);
+	  if(isset($app->modules->current_datalog_id) && $app->modules->current_datalog_id > 0) $this->query("UPDATE sys_datalog set error = '".$this->quote($errormsg)."' WHERE datalog_id = ".$app->modules->current_datalog_id);
 
       return true;
     }

--
Gitblit v1.9.1