Skip to content

Commit d3e39db

Browse files
ganlchriskacerguis
authored andcommitted
Fix: A Database Error Occurred when update logs (_log_access_time and _log_response_code) (#830)
1 parent 27f26f0 commit d3e39db

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

application/libraries/REST_Controller.php

+8
Original file line numberDiff line numberDiff line change
@@ -2212,6 +2212,10 @@ protected function _force_login($nonce = '')
22122212
*/
22132213
protected function _log_access_time()
22142214
{
2215+
if($this->_insert_id == ''){
2216+
return false;
2217+
}
2218+
22152219
$payload['rtime'] = $this->_end_rtime - $this->_start_rtime;
22162220

22172221
return $this->rest->db->update(
@@ -2230,6 +2234,10 @@ protected function _log_access_time()
22302234
*/
22312235
protected function _log_response_code($http_code)
22322236
{
2237+
if($this->_insert_id == ''){
2238+
return false;
2239+
}
2240+
22332241
$payload['response_code'] = $http_code;
22342242

22352243
return $this->rest->db->update(

0 commit comments

Comments
 (0)