From 1690e601573ba7e87409b350b7815dbbde295df2 Mon Sep 17 00:00:00 2001 From: Vincent Valot Date: Tue, 27 Jun 2023 14:57:08 +0200 Subject: [PATCH] fix: prevent access to null config_ in SimpleAbrManager --- lib/abr/simple_abr_manager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/abr/simple_abr_manager.js b/lib/abr/simple_abr_manager.js index 304d11eec2..0b5a885ffc 100644 --- a/lib/abr/simple_abr_manager.js +++ b/lib/abr/simple_abr_manager.js @@ -54,7 +54,7 @@ shaka.abr.SimpleAbrManager = class { // of connectivity changes. if (navigator.connection && navigator.connection.addEventListener) { this.onNetworkInformationChange_ = () => { - if (this.config_.useNetworkInformation && this.enabled_) { + if (this.enabled_ && this.config_.useNetworkInformation) { this.bandwidthEstimator_ = new shaka.abr.EwmaBandwidthEstimator(); if (this.config_) { this.bandwidthEstimator_.configure(this.config_.advanced);