diff --git a/src/pow.directive.js b/src/pow.directive.js index 632d35f..c7def99 100644 --- a/src/pow.directive.js +++ b/src/pow.directive.js @@ -14,12 +14,16 @@ scope.$watch(attrs.arrayBuffer, function(arrayBuffer) { - if (scope.data.arrayBuffer.__proto__.toString() === "[object ArrayBuffer]") { - window.player.fetch(arrayBuffer); + if(scope.data.arrayBuffer){ + + if (scope.data.arrayBuffer.__proto__.toString() === "[object ArrayBuffer]") { + window.player.fetch(arrayBuffer); + + $timeout(function() { + scope.data.arrayBuffer = {}; + }, 0, false); + } - $timeout(function() { - scope.data.arrayBuffer = {}; - }, 0, false); }