diff --git a/dialog.js b/dialog.js index 60f955e..8dccf65 100644 --- a/dialog.js +++ b/dialog.js @@ -501,7 +501,7 @@ angular.module('ayDialog', []) restoreScroll = blockScrolling(offset); - if (prevFocus != $window.document.body) { + if (prevFocus && (prevFocus != $window.document.body)) { prevFocus.blur(); }