Browse files

Listview: add extra check to fix issue #4901

If a listview was nested inside a normal list then the listviewcreate
event for autodividers would also fire for the parent list causing an error
as this list did not contain listview data. An extra check is added to ensure
the list is actually a listview.

Fixes issue #4901
  • Loading branch information...
1 parent 337e9e0 commit d669a2224c0f27bf44e601983ce999c604d3d47d @marcins marcins committed with Aug 30, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 js/widgets/listview.autodividers.js
View
2 js/widgets/listview.autodividers.js
@@ -26,7 +26,7 @@ $( document ).delegate( "ul,ol", "listviewcreate", function() {
var list = $( this ),
listview = list.data( "listview" );
- if ( !listview.options.autodividers ) {
+ if ( !listview || !listview.options.autodividers ) {
return;
}

0 comments on commit d669a22

Please sign in to comment.