diff options
| author | Will Hawkins <[email protected]> | 2022-06-12 17:31:09 -0400 |
|---|---|---|
| committer | Will Hawkins <[email protected]> | 2022-06-12 17:31:09 -0400 |
| commit | c93a4dedc897f84992a6a34200fe954ba2ca435d (patch) | |
| tree | 83643f39a3037599924485dffa7af114ecacea3b /networkQuality.go | |
| parent | bce8d0a53c56816e6b5acd4e0c9b53514981910a (diff) | |
[Bugfix] Dereference nil when type assertions failed in IncorporateConnectionStats
Errors as a result of failed type assertions in
IncorporateConnectionStats were caught/logged but there was no
function-termination control flow associated with these error
conditions. As a result, control would continue and cause problems. This
patch fixes that.
Diffstat (limited to 'networkQuality.go')
| -rw-r--r-- | networkQuality.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/networkQuality.go b/networkQuality.go index e5e3631..c7dd74b 100644 --- a/networkQuality.go +++ b/networkQuality.go @@ -313,7 +313,9 @@ func main() { if !extendedstats.ExtendedStatsAvailable() { panic("Extended stats are not available but the user requested their calculation.") } - extendedStats.IncorporateConnectionStats(downloadSaturation.LGCs[i].Stats().ConnInfo.Conn) + if err := extendedStats.IncorporateConnectionStats(downloadSaturation.LGCs[i].Stats().ConnInfo.Conn); err != nil { + fmt.Fprintf(os.Stderr, "Warning: Could not add extended stats for the connection: %v", err) + } } } |
