Fix crash when interface monitor is unavailable

This commit is contained in:
世界
2026-09-06 14:56:27 +08:00
parent a25ad8ce52
commit 288411b0b9
4 changed files with 18 additions and 3 deletions
+5 -1
View File
@@ -99,7 +99,11 @@ func (h *Outbound) Start(stage adapter.StartStage) error {
}
func (h *Outbound) fetchMyAddresses() {
myInterfaceNames := h.network.InterfaceMonitor().MyInterfaces()
interfaceMonitor := h.network.InterfaceMonitor()
if interfaceMonitor == nil {
return
}
myInterfaceNames := interfaceMonitor.MyInterfaces()
if len(myInterfaceNames) == 0 {
return
}