Commit 45b14c3c authored by Mark Harding's avatar Mark Harding

(fix): do not throw error if missing item from feed

parent 94ac1b46
No related merge requests found
Pipeline #81696763 running with stages
......@@ -83,6 +83,7 @@ export class SentryErrorHandler implements ErrorHandler {
handleError(error) {
// const eventId = Sentry.captureException(error.originalError || error);
// Sentry.showReportDialog({ eventId });
console.error(error);
}
}
......
import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable } from 'rxjs';
import { first } from 'rxjs/operators';
import { BehaviorSubject, Observable, of } from 'rxjs';
import { first, catchError } from 'rxjs/operators';
import { Client } from '../../services/api';
import { BlockListService } from './block-list.service';
......@@ -64,8 +64,15 @@ export class EntitiesService {
}
for (const feedItem of feed) {
if (!blockedGuids || blockedGuids.indexOf(feedItem.owner_guid) < 0)
entities.push(this.entities.get(feedItem.urn));
if (
this.entities.has(feedItem.urn) &&
(!blockedGuids || blockedGuids.indexOf(feedItem.owner_guid) < 0)
)
entities.push(
this.entities
.get(feedItem.urn)
.pipe(catchError(err => new BehaviorSubject(null)))
);
}
return entities;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment