Skip to content

Commit

Permalink
[PBW-4980] Check if playerId exists before usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Angie Israni committed Apr 11, 2016
1 parent 4c166b6 commit 590683b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/js/main_html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 590683b

Please sign in to comment.