Bubble [main]

Fixed exception when a notification is not found

=> c9becb9301c032ea7c14ee6c01c641a573bdd742

diff --git a/model.py b/model.py
index 87290d2..97a8421 100644
--- a/model.py
+++ b/model.py
@@ -1597,7 +1597,10 @@ class Database:
         return notifs
 
     def get_notification(self, user, id, clear=False) -> Notification:
-        return self.get_notifications(user, id=id, clear=clear)[0]
+        notif = self.get_notifications(user, id=id, clear=clear)
+        if notif:
+            return notif[0]
+        return None
 
     TOKEN_CHARS = [chr(ord('a') + i) for i in range(26)] + \
                   [chr(ord('A') + i) for i in range(26)] + \
Proxy Information
Original URL
gemini://git.skyjake.fi/bubble/main/cdiff/c9becb9301c032ea7c14ee6c01c641a573bdd742
Status Code
Success (20)
Meta
text/gemini; charset=utf-8
Capsule Response Time
29.989176 milliseconds
Gemini-to-HTML Time
0.289639 milliseconds

This content has been proxied by September (3851b).