Move sql statement reset

In case the decomrpession call causes us to error, we leave a sql
statement in a dirty state. Move the reset earlier so we don't leave
a dirty statement.
This commit is contained in:
Robin Malley 2023-04-06 20:21:08 +00:00
parent fee8997e80
commit fea953fdef
1 changed files with 1 additions and 2 deletions

View File

@ -5,7 +5,6 @@ local db = require("db")
local queries = require("queries")
local util = require("util")
local pages = require("pages")
local tags = require("tags")
local session = require("session")
local config = require("config")
@ -56,11 +55,11 @@ found, please report this error.
end
assert(err == sql.ROW)
local data = stmnt_bio:get_values()
stmnt_bio:reset()
local bio_text = data[1]
if data[1] ~= "" then
bio_text = zlib.decompress(data[1])
end
stmnt_bio:reset()
ret = pages.edit_bio{
text = bio_text,
user = author,