Fix possible nullpointer exception

This commit is contained in:
Julian Kornberger 2016-07-14 12:38:32 +02:00
parent c30d6bc281
commit 2afc795e74

View File

@ -27,9 +27,13 @@ type WirelessAirtime struct {
// Calculates the utilization values in regard to the previous values // Calculates the utilization values in regard to the previous values
func (cur *WirelessStatistics) SetUtilization(prev *WirelessStatistics) { func (cur *WirelessStatistics) SetUtilization(prev *WirelessStatistics) {
if cur.Airtime24 != nil {
cur.Airtime24.SetUtilization(prev.Airtime24) cur.Airtime24.SetUtilization(prev.Airtime24)
}
if cur.Airtime5 != nil {
cur.Airtime5.SetUtilization(prev.Airtime5) cur.Airtime5.SetUtilization(prev.Airtime5)
} }
}
// Calculates the utilization values in regard to the previous values // Calculates the utilization values in regard to the previous values
func (cur *WirelessAirtime) SetUtilization(prev *WirelessAirtime) { func (cur *WirelessAirtime) SetUtilization(prev *WirelessAirtime) {