]> cat aescling's git repositories - mastodon.git/commitdiff
Fix TypeError on follow notification (#6950)
authorunarist <m.unarist@gmail.com>
Thu, 29 Mar 2018 10:59:12 +0000 (19:59 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 29 Mar 2018 10:59:12 +0000 (12:59 +0200)
`notification.status` may not be present, e.g. follow notification.

app/javascript/mastodon/actions/notifications.js

index 7267b85bd0260d22a0ff24c078d28147786efb75..da77afbe0eeb534f9a44f54bf7634ee44d57651d 100644 (file)
@@ -43,7 +43,9 @@ export function updateNotifications(notification, intlMessages, intlLocale) {
     const playSound = getState().getIn(['settings', 'notifications', 'sounds', notification.type], true);
 
     dispatch(importFetchedAccount(notification.account));
-    dispatch(importFetchedStatus(notification.status));
+    if (notification.status) {
+      dispatch(importFetchedStatus(notification.status));
+    }
 
     dispatch({
       type: NOTIFICATIONS_UPDATE,