From 590683b8188327ec778d2bde197199403610d818 Mon Sep 17 00:00:00 2001 From: Angie Israni Date: Mon, 11 Apr 2016 13:59:23 -0700 Subject: [PATCH] [PBW-4980] Check if playerId exists before usage --- src/main/js/main_html5.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/js/main_html5.js b/src/main/js/main_html5.js index 87736bdb..469d9503 100644 --- a/src/main/js/main_html5.js +++ b/src/main/js/main_html5.js @@ -60,7 +60,9 @@ require("../../../html5-common/js/utils/environment.js"); * @returns {object} A reference to the wrapper for the newly created element */ this.create = function(parentContainer, domId, controller, css, playerId) { - if (this.maxSupportedElements > 0 && currentInstances[playerId] >= this.maxSupportedElements) { + // If the current player has reached max supported elements, do not create a new one + if (this.maxSupportedElements > 0 && playerId && + currentInstances[playerId] >= this.maxSupportedElements) { return; }