Skip to content

Commit d6feab0

Browse files
committed
Fix crash when creating first collector on new account
AppManagingAccount.createCollectorUnitialized assumed streamData.children existed, but newly created streams have no children array. Added guard matching the existing pattern in Collector.ts.
1 parent 1f54504 commit d6feab0

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

ts/appTemplates/AppManagingAccount.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ export class AppManagingAccount extends Application {
142142
};
143143
const stream = await this.connection.apiOne('streams.create', params, 'stream');
144144
// add new stream to streamCache
145+
if (!this.streamData.children) this.streamData.children = [];
145146
this.streamData.children.push(stream);
146147
const collector = new Collector(this, stream);
147148
this.cache.collectorsMap[collector.streamId] = collector;

0 commit comments

Comments
 (0)