Skip to content

Commit

Permalink
initialize Storage before accessing it (#1572)
Browse files Browse the repository at this point in the history
* initialize Storage before accessing it

* Ok do it differently
  • Loading branch information
Apollon77 authored Dec 27, 2024
1 parent 1077d60 commit 9f74a02
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/nodejs-shell/src/MatterNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class MatterNode {
id,
},
autoConnect: false,
adminFabricLabel: await this.Store.get<string>("ControllerFabricLabel", "matter.js Shell"),
adminFabricLabel: "matter.js Shell",
});
await this.commissioningController.initializeControllerStore();

Expand All @@ -71,6 +71,12 @@ export class MatterNode {
}
this.storageContext = controllerStore.storage.createContext("Node");

if (await this.Store.has("ControllerFabricLabel")) {
await this.commissioningController.updateFabricLabel(
await this.Store.get<string>("ControllerFabricLabel", "matter.js Shell"),
);
}

const storageService = this.#environment.get(StorageService);
const baseLocation = storageService.location;
if (baseLocation !== undefined) {
Expand Down

0 comments on commit 9f74a02

Please sign in to comment.