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 2024-08-02 14:26:09 +02:00 committed by Oliver Gugger
parent b45deab379
commit ac0d29580e
No known key found for this signature in database
GPG key ID: 8E4256593F177720

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)
}