mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-07 16:33:08 +00:00
fix: fixes out of bounds crash when waku2 is not set (#1895)
This commit is contained in:
parent
b45e70505c
commit
76e25a6d48
@ -76,6 +76,9 @@ func waku2*(record: TypedRecord): Option[CapabilitiesBitfield] =
|
||||
if field.isNone():
|
||||
return none(CapabilitiesBitfield)
|
||||
|
||||
if field.get().len != 1:
|
||||
return none(CapabilitiesBitfield)
|
||||
|
||||
some(CapabilitiesBitfield(field.get()[0]))
|
||||
|
||||
proc supportsCapability*(r: Record, cap: Capabilities): bool =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user