Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 03190fd

Browse files
chore(ngMock): check that ngMock.$browser.pollFns exists before emptying
1 parent 340e4da commit 03190fd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ngMock/angular-mocks.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -2237,7 +2237,8 @@ if (window.jasmine || window.mocha) {
22372237

22382238
if (injector) {
22392239
injector.get('$rootElement').off();
2240-
injector.get('$browser').pollFns.length = 0;
2240+
var $browser = injector.get('$browser');
2241+
if ($browser.pollFns) $browser.pollFns.length = 0;
22412242
}
22422243

22432244
// clean up jquery's fragment cache

0 commit comments

Comments
 (0)