Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(layout): prevents missing body error in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Messerle committed Sep 23, 2015
1 parent 968aa23 commit c3a2ada
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/services/layout/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@
// Perform a read-once (1x) check for the `md-css-only` class on the BODY

if ( angular.isUndefined(disablePostLinks) ) {
disablePostLinks = document.body.classList.contains('md-css-only');
var body = document.body;
if (body) disablePostLinks = body.classList.contains('md-css-only');
}

return $$mdLayout.disablePostLinks = disablePostLinks;
Expand Down

0 comments on commit c3a2ada

Please sign in to comment.