diff --git a/test/components/views/messages/MBeaconBody-test.tsx b/test/components/views/messages/MBeaconBody-test.tsx index a466f9be9e..1e8af0e561 100644 --- a/test/components/views/messages/MBeaconBody-test.tsx +++ b/test/components/views/messages/MBeaconBody-test.tsx @@ -436,7 +436,7 @@ describe("", () => { beforeEach(() => { // mock map utils to raise MapStyleUrlNotConfigured error jest.spyOn(mapUtilHooks, "useMap").mockImplementation(({ onError }) => { - onError(new Error(LocationShareError.MapStyleUrlNotConfigured)); + onError?.(new Error(LocationShareError.MapStyleUrlNotConfigured)); return mockMap; }); });