Skip to content
Browse files

null check meny parent

  • Loading branch information...
1 parent 96f4847 commit c76407d3152aaa0ce3a4915d4ec1fb5a2527a819 @hakimel hakimel committed Aug 9, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 js/meny.js
View
5 js/meny.js
@@ -8,12 +8,13 @@
(function(){
var meny = document.querySelector( '.meny' );
- var menyWrapper = meny.parentNode;
// Avoid throwing errors if the script runs on a page with
// no .meny
- if( !meny || !menyWrapper ) { return; }
+ if( !meny || !meny.parentNode ) { return; }
+ var menyWrapper = meny.parentNode;
+
// Add a class to identify the parent of the meny parts
menyWrapper.className += ' meny-wrapper';

0 comments on commit c76407d

Please sign in to comment.
Something went wrong with that request. Please try again.