Skip to content

Commit 801add3

Browse files
committed
fix: throw error if try to call wasm function and not initialized
1 parent f967a54 commit 801add3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/js/interface/NavigraphNavigationDataInterface.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,10 @@ export class NavigraphNavigationDataInterface {
345345
* @returns A promise that resolves when the function returns
346346
*/
347347
private async callWasmFunction<T = unknown>(name: keyof typeof NavigraphFunction, data: unknown): Promise<T> {
348+
if (!this.isInitialized) {
349+
throw new Error("Interface is not initialized")
350+
}
351+
348352
const id = Utils.generateGUID()
349353

350354
const args = {

0 commit comments

Comments
 (0)