nil pointer protection

pull/2034/head
v2ray 2016-08-07 08:45:03 +02:00
parent 0caf2e6d30
commit 2f0d602833
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
1 changed files with 1 additions and 1 deletions

View File

@ -165,7 +165,7 @@ func (this *SendingWindow) Flush(current uint32, resend uint32, rto uint32, maxI
} }
} }
if inFlightSize > 0 && this.totalInFlightSize != 0 { if this.onPacketLoss != nil && inFlightSize > 0 && this.totalInFlightSize != 0 {
rate := lost * 100 / this.totalInFlightSize rate := lost * 100 / this.totalInFlightSize
this.onPacketLoss(rate) this.onPacketLoss(rate)
} }