From 43350ebfbd8ada6145e14b71267e1f745a075496 Mon Sep 17 00:00:00 2001 From: gambas Date: Mon, 10 Dec 2018 23:35:21 +0100 Subject: [PATCH] Connection.LastInsertId now raises an error instead of crashing when the connection is closed. [GB.DB] * BUG: Connection.LastInsertId now raises an error instead of crashing when the connection is closed. --- main/lib/db/CConnection.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main/lib/db/CConnection.c b/main/lib/db/CConnection.c index f339d704d..544d844a8 100644 --- a/main/lib/db/CConnection.c +++ b/main/lib/db/CConnection.c @@ -766,6 +766,8 @@ END_PROPERTY BEGIN_PROPERTY(Connection_LastInsertId) CHECK_DB(); + CHECK_OPEN(); + GB.ReturnLong((*THIS->driver->GetLastInsertId)(&THIS->db)); END_PROPERTY