diff options
author | Ted Trask <ttrask01@yahoo.com> | 2014-06-30 16:48:26 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2014-06-30 16:48:26 +0000 |
commit | 26d839823382a7245617fd1e08bafb402dda3f42 (patch) | |
tree | 049815d6f9ddef1b4349a4d67aeb5cbd408e9e9c | |
parent | 92bb31d19c1c6fd226d8e785b8f842abcde93735 (diff) | |
download | acf-lib-26d839823382a7245617fd1e08bafb402dda3f42.tar.bz2 acf-lib-26d839823382a7245617fd1e08bafb402dda3f42.tar.xz |
Fix null pointer exceptions in db referencing table_creation_scripts
-rw-r--r-- | db.lua | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) |