Fixes: crash in issue #34

prevent crash vector from legacy null field and give meaningful output for a permanent ban in the GUI
master
shivajiva101 2021-12-09 00:46:34 +00:00 committed by GitHub
parent fc1df33e5f
commit 440000d82b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1477,8 +1477,10 @@ local function create_info(entry)
end
local str = "Banned by: "..entry.source.."\n"
.."When: "..hrdf(entry.created).."\n"
if entry.expires ~= 0 then
if type(entry.expires) == "number" and entry.expires > 0 then
str = str.."Expires: "..hrdf(entry.expires).."\n"
else
str = str.."Expires: never, permanent ban!".."\n"
end
str = str .."Reason: "
-- Word wrap