From 53b2dd456dea6c237b5589f17f2ec7b549e810e3 Mon Sep 17 00:00:00 2001 From: Anon Date: Sun, 12 Mar 2023 20:16:44 -0700 Subject: [PATCH] Corrected after_pick() logic --- src/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 1a84495..e2f6a98 100755 --- a/src/main.py +++ b/src/main.py @@ -125,11 +125,13 @@ class YandereBot(FediBot.YandereBot): # Maybe I should remove this from the backend? def print_header_stats(self, picked): profile, frame, nsfw, path = None, None, None, None + if picked: profile = picked.profile_name frame = picked.picked_frame nsfw = picked.is_nsfw() path = picked.output_name_tr + print("Profile: {} | Frame: {} | NSFW: {} | Path: {}".format( profile, frame, nsfw, path )) @@ -151,7 +153,10 @@ class YandereBot(FediBot.YandereBot): } def after_pick(self, picked): - self.print_header_stats(picked["picked"]) + if picked: + self.print_header_stats(picked["picked"]) + else: + self.print_header_stats(None) def post(self, picked): try: