Use the correct test order. Close #3513

This commit is contained in:
nnposter 2026-09-23 21:38:54 +00:00
parent b218bfc230
commit 843315b8f5

View file

@ -154,7 +154,7 @@ end
function record_read(buffer, i)
local i, h = read_header(buffer, i)
if #buffer - i + 1 < h.record_length or not h then
if not h or #buffer - i + 1 < h.record_length then
return i, nil
end