]> Untitled Git - lemmy.git/commitdiff
Fixing a bug with follower view
authorDessalines <tyhou13@gmx.com>
Wed, 17 Apr 2019 23:42:29 +0000 (16:42 -0700)
committerDessalines <tyhou13@gmx.com>
Wed, 17 Apr 2019 23:42:29 +0000 (16:42 -0700)
server/src/websocket_server/server.rs

index c4afa69629641263a7655476c117d0d1c5db6991..a4c5b62037e15cebfc8ce19705576200df8c2f19 100644 (file)
@@ -1723,7 +1723,12 @@ impl Perform for GetFollowedCommunities {
 
     let user_id = claims.id;
 
-    let communities: Vec<CommunityFollowerView> = CommunityFollowerView::for_user(&conn, user_id).unwrap();
+    let communities: Vec<CommunityFollowerView> = match CommunityFollowerView::for_user(&conn, user_id) {
+      Ok(communities) => communities,
+      Err(_e) => {
+        return self.error("System error, try logging out and back in.");
+      }
+    };
 
     // Return the jwt
     serde_json::to_string(