Fix missing null check when importing collections from notifications (#39300)
This commit is contained in:
parent
2d2a7ec8d6
commit
c08d13a65c
@ -88,7 +88,7 @@ function dispatchAssociatedRecords(
|
||||
fetchedStatuses.push(notification.status);
|
||||
}
|
||||
|
||||
if ('collection' in notification) {
|
||||
if ('collection' in notification && notification.collection) {
|
||||
collections.push(notification.collection);
|
||||
}
|
||||
});
|
||||
|
||||
@ -90,22 +90,22 @@ interface ReportNotificationJSON extends BaseNotificationJSON {
|
||||
|
||||
interface AddedToCollectionNotificationGroupJSON extends BaseNotificationGroupJSON {
|
||||
type: 'added_to_collection';
|
||||
collection: ApiCollectionJSON;
|
||||
collection: ApiCollectionJSON | null;
|
||||
}
|
||||
|
||||
interface AddedToCollectionNotificationJSON extends BaseNotificationJSON {
|
||||
type: 'added_to_collection';
|
||||
collection: ApiCollectionJSON;
|
||||
collection: ApiCollectionJSON | null;
|
||||
}
|
||||
|
||||
interface CollectionUpdateNotificationGroupJSON extends BaseNotificationGroupJSON {
|
||||
type: 'collection_update';
|
||||
collection: ApiCollectionJSON;
|
||||
collection: ApiCollectionJSON | null;
|
||||
}
|
||||
|
||||
interface CollectionUpdateNotificationJSON extends BaseNotificationJSON {
|
||||
type: 'collection_update';
|
||||
collection: ApiCollectionJSON;
|
||||
collection: ApiCollectionJSON | null;
|
||||
}
|
||||
|
||||
type SimpleNotificationTypes = 'follow' | 'follow_request' | 'admin.sign_up';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user