mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-08 16:28:49 +00:00
throw when subscription is created without filters.
fixes https://github.com/nbd-wtf/nostr-tools/pull/497
This commit is contained in:
@@ -481,6 +481,8 @@ export class Subscription {
|
||||
private eoseTimeoutHandle: ReturnType<typeof setTimeout> | undefined
|
||||
|
||||
constructor(relay: AbstractRelay, id: string, filters: Filter[], params: SubscriptionParams) {
|
||||
if (filters.length === 0) throw new Error("subscription can't be created with zero filters")
|
||||
|
||||
this.relay = relay
|
||||
this.filters = filters
|
||||
this.id = id
|
||||
|
||||
Reference in New Issue
Block a user