mirror of
https://github.com/owncast/owncast.git
synced 2024-11-21 12:18:02 +03:00
fix(video): fix nil reference exception in playback metrics. Closes #3984
This commit is contained in:
parent
05545cb6da
commit
0fccaa61fe
1 changed files with 3 additions and 3 deletions
|
@ -30,15 +30,15 @@ func ReportPlaybackMetrics(w http.ResponseWriter, r *http.Request) {
|
|||
clientID := utils.GenerateClientIDFromRequest(r)
|
||||
|
||||
metrics.RegisterPlaybackErrorCount(clientID, *request.Errors)
|
||||
if *request.Bandwidth != 0.0 {
|
||||
if request.Bandwidth != nil && *request.Bandwidth != 0.0 {
|
||||
metrics.RegisterPlayerBandwidth(clientID, *request.Bandwidth)
|
||||
}
|
||||
|
||||
if *request.Latency != 0.0 {
|
||||
if request.Latency != nil && *request.Latency != 0.0 {
|
||||
metrics.RegisterPlayerLatency(clientID, *request.Latency)
|
||||
}
|
||||
|
||||
if *request.DownloadDuration != 0.0 {
|
||||
if request.DownloadDuration != nil && *request.DownloadDuration != 0.0 {
|
||||
metrics.RegisterPlayerSegmentDownloadDuration(clientID, *request.DownloadDuration)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue