channeldb: skip nil scheduler options

This is a robustness option to ensure LND doesn't crash when this
function is accidentally called with `AddChannelEdge(edge, nil)`.
This commit is contained in:
Jesse de Wit committed 2024-11-14 11:42:22 +01:00
1 parent 7d9d100e94
commit c84126309d
1 file changed
+4
+4
View File
@@ -1023,6 +1023,10 @@ func (c *ChannelGraph) AddChannelEdge(edge *models.ChannelEdgeInfo,
}
for _, f := range op {
if f == nil {
return fmt.Errorf("nil scheduler option was used")
}
f(r)
}