Skip to content

Commit 595063c

Browse files
committed
minor changes in logging and type check of socket messages
1 parent 8be509d commit 595063c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

client/src/app/dashboard/graph-view/graph-view.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export class GraphViewService {
2626
this.elementRemover = new BehaviorSubject<Array<string>>([]);
2727

2828
this.modelService.getObservableForInstances().subscribe((change: Change) => {
29+
console.log('received notification in graph view service', change);
2930
if (change.elements !== undefined) {
3031
switch (change.type) {
3132
case Actions.ADD:
@@ -44,7 +45,7 @@ export class GraphViewService {
4445
}
4546

4647
private addElements(instances: Array<Instance>) {
47-
console.log('received new instance', instances);
48+
console.log('received new instance in graph view service', instances);
4849
const newElements: NodeEdgeMap = instances.reduce(
4950
( accumulator: NodeEdgeMap, value: Instance) => {
5051

client/src/app/model/models/socketMessage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,5 @@ export function payloadIsInstanceLink(payload: any): payload is InstanceLink {
8181

8282

8383
export function objectIsMessage(obj: any): obj is RegistryEvent {
84-
return obj.eventType !== undefined && obj.payload !== undefined;
84+
return obj !== null && obj.eventType !== undefined && obj.payload !== undefined;
8585
}

0 commit comments

Comments
 (0)