Skip to content

Commit da31fca

Browse files
authored
Checking error in the select_old module when (#180)
Checking error in the select_old module when receiving iterator is now called earlier than checking tuple. Closes #144
1 parent dc618eb commit da31fca

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crud/select/compat/select_old.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,14 @@ function select_module.pairs(space_name, user_conditions, opts)
218218

219219
local gen = function(_, iter)
220220
local tuple, err = iter:get()
221-
if tuple == nil then
222-
return nil
223-
end
224-
225221
if err ~= nil then
226222
error(string.format("Failed to get next object: %s", err))
227223
end
228224

225+
if tuple == nil then
226+
return nil
227+
end
228+
229229
local result = tuple
230230
if opts.use_tomap == true then
231231
result, err = utils.unflatten(tuple, iter.space_format)

0 commit comments

Comments
 (0)