From e1e99957b6188cce657485f15ff3708fef9e5999 Mon Sep 17 00:00:00 2001 From: Mia Herkt Date: Thu, 29 Dec 2022 19:51:04 +0100 Subject: [PATCH] ModUI: Fix crash when encountering null NSFW score Fixes #78 --- mod.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod.py b/mod.py index 4ef3ced..9a68e79 100755 --- a/mod.py +++ b/mod.py @@ -251,7 +251,7 @@ class NullptrMod(Screen): ("Uploaded by:", Text(f.addr)), ("Management token:", f.mgmt_token), ("Secret:", f.secret), - ("Is NSFW:", ("Yes" if f.is_nsfw else "No") + f" (Score: {f.nsfw_score:0.4f})"), + ("Is NSFW:", ("Yes" if f.is_nsfw else "No") + (f" (Score: {f.nsfw_score:0.4f})" if f.nsfw_score else " (Not scanned)")), ("Is banned:", "Yes" if f.removed else "No"), ("Expires:", time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(File.get_expiration(f.expiration, f.size)/1000))) ])