summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-06-30 16:48:26 +0000
committerTed Trask <ttrask01@yahoo.com>2014-06-30 16:48:26 +0000
commit26d839823382a7245617fd1e08bafb402dda3f42 (patch)
tree049815d6f9ddef1b4349a4d67aeb5cbd408e9e9c
parent92bb31d19c1c6fd226d8e785b8f842abcde93735 (diff)
downloadacf-lib-26d839823382a7245617fd1e08bafb402dda3f42.tar.bz2
acf-lib-26d839823382a7245617fd1e08bafb402dda3f42.tar.xz
Fix null pointer exceptions in db referencing table_creation_scripts
-rw-r--r--db.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/db.lua b/db.lua
index 5d07c4c..214cf39 100644
--- a/db.lua
+++ b/db.lua
@@ -69,7 +69,7 @@ export.runsqlcommand = function(dbobject, sql, transaction)
elseif dbobject.engine == mymodule.engine.sqlite3 then
table = string.match(err, "LuaSQL: no such table: (%S+)")
end
- if table and dbobject.table_creation_scripts[table] then
+ if table and dbobject.table_creation_scripts and dbobject.table_creation_scripts[table] then
if transaction then assert(dbobject.con:execute("ROLLBACK TO before_command")) end
dbobject.runscript(dbobject.table_creation_scripts[table])
dbobject.runsqlcommand(sql)
@@ -110,7 +110,7 @@ export.getselectresponse = function(dbobject, sql, transaction)
elseif dbobject.engine == mymodule.engine.sqlite3 then
table = string.match(err, "LuaSQL: no such table: (%S+)")
end
- if table and dbobject.table_creation_scripts[table] then
+ if table and dbobject.table_creation_scripts and dbobject.table_creation_scripts[table] then
if transaction then assert(con:execute("ROLLBACK TO before_select")) end
dbobject.runscript(dbobject.table_creation_scripts[table])
return dbobject.getselectresponse(sql)