-
Notifications
You must be signed in to change notification settings - Fork 117
Open
Description
If I call ndk.fetchEvent() with an invalid filter, a filter with an invalid id, it throws the following error:
Error: Invalid filter(s) detected:
Filter[0].ids[0] is not a valid 64-char hex string: "invalid_id"
Which is fine, but not much later the entire app crashes with the following error:
file://<project_folder>/node_modules/@nostr-dev-kit/ndk/dist/index.mjs:11644
s.stop();
^
ReferenceError: Cannot access 's' before initialization
at Timeout._onTimeout (file://<project_folder>/node_modules/@nostr-dev-kit/ndk/dist/index.mjs:11644:9)
at listOnTimeout (node:internal/timers:588:17)
at process.processTimers (node:internal/timers:523:7)
I looked into your code a bit. I'm by far not experienced enough to understand everything or comment on anything. But my guess is it might be a simple fix right here:
Line 1060 in 5d69cea
| s.stop(); |
I think a question mark was forgotten there? And it should be s?.stop(); instead?
I'm assuming the first error is thrown here:
Line 1065 in 5d69cea
| s = this.subscribe(filters, subscribeOpts); |
Which causes s never to be initialized.
Metadata
Metadata
Assignees
Labels
No labels