fix tracker nil porinter #1057

This commit is contained in:
Alireza Ahmadi
2026-03-22 19:10:59 +01:00
parent 9d35e02e0e
commit d21993804c
+10 -2
View File
@@ -22,10 +22,18 @@ type StatsService struct {
}
func (s *StatsService) SaveStats(enableTraffic bool) error {
if !corePtr.IsRunning() {
if corePtr == nil || !corePtr.IsRunning() {
return nil
}
stats := corePtr.GetInstance().StatsTracker().GetStats()
box := corePtr.GetInstance()
if box == nil {
return nil
}
st := box.StatsTracker()
if st == nil {
return nil
}
stats := st.GetStats()
// Reset onlines
onlineResources.Inbound = nil