diff --git a/phpgwapi/inc/class.db.inc.php b/phpgwapi/inc/class.db.inc.php index 49c47c994d..f7a06f1590 100644 --- a/phpgwapi/inc/class.db.inc.php +++ b/phpgwapi/inc/class.db.inc.php @@ -575,11 +575,11 @@ */ function halt($msg, $line = '', $file = '') { - $this->Error = $this->Link_ID->ErrorMsg(); // need to be BEFORE unlock, - $this->Errno = $this->Link_ID->ErrorNo(); // else we get its error or none - if ($this->Link_ID) // only if we have a link, else infinite loop { + $this->Error = $this->Link_ID->ErrorMsg(); // need to be BEFORE unlock, + $this->Errno = $this->Link_ID->ErrorNo(); // else we get its error or none + $this->unlock(); /* Just in case there is a table currently locked */ } if ($this->Halt_On_Error == "no")