Fix missing null check when importing collections from notifications (#39300)

This commit is contained in:
diondiondion 2026-06-05 12:01:55 +02:00 committed by GitHub
parent 2d2a7ec8d6
commit c08d13a65c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -88,7 +88,7 @@ function dispatchAssociatedRecords(
fetchedStatuses.push(notification.status); fetchedStatuses.push(notification.status);
} }
if ('collection' in notification) { if ('collection' in notification && notification.collection) {
collections.push(notification.collection); collections.push(notification.collection);
} }
}); });

View File

@ -90,22 +90,22 @@ interface ReportNotificationJSON extends BaseNotificationJSON {
interface AddedToCollectionNotificationGroupJSON extends BaseNotificationGroupJSON { interface AddedToCollectionNotificationGroupJSON extends BaseNotificationGroupJSON {
type: 'added_to_collection'; type: 'added_to_collection';
collection: ApiCollectionJSON; collection: ApiCollectionJSON | null;
} }
interface AddedToCollectionNotificationJSON extends BaseNotificationJSON { interface AddedToCollectionNotificationJSON extends BaseNotificationJSON {
type: 'added_to_collection'; type: 'added_to_collection';
collection: ApiCollectionJSON; collection: ApiCollectionJSON | null;
} }
interface CollectionUpdateNotificationGroupJSON extends BaseNotificationGroupJSON { interface CollectionUpdateNotificationGroupJSON extends BaseNotificationGroupJSON {
type: 'collection_update'; type: 'collection_update';
collection: ApiCollectionJSON; collection: ApiCollectionJSON | null;
} }
interface CollectionUpdateNotificationJSON extends BaseNotificationJSON { interface CollectionUpdateNotificationJSON extends BaseNotificationJSON {
type: 'collection_update'; type: 'collection_update';
collection: ApiCollectionJSON; collection: ApiCollectionJSON | null;
} }
type SimpleNotificationTypes = 'follow' | 'follow_request' | 'admin.sign_up'; type SimpleNotificationTypes = 'follow' | 'follow_request' | 'admin.sign_up';