From eaddfe5ed6c669fab4210025f443efa72ab23748 Mon Sep 17 00:00:00 2001 From: Hunternif Date: Sun, 2 Oct 2022 05:01:39 +0100 Subject: server: fix null error in lookalikes for videos --- server/szurubooru/api/post_api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/szurubooru/api/post_api.py b/server/szurubooru/api/post_api.py index b89a7f6..e5ca037 100644 --- a/server/szurubooru/api/post_api.py +++ b/server/szurubooru/api/post_api.py @@ -330,6 +330,9 @@ def get_posts_lookalikes( threshold = ctx.get_param_as_float("threshold", default=1, min=0, max=100) post_id = _get_post_id(params) post = posts.get_post_by_id(post_id) + if post.signature is None: + return {"similarPosts": []} + sig = image_hash.unpack_signature(post.signature.signature) # limit + 1 because the original post will be excluded lookalikes = posts.search_by_signature(sig, limit + 1, threshold) -- cgit v1.3