Skip to content

Commit

Permalink
better null check for stack (closes hakimel#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed Mar 4, 2013
1 parent 3bae233 commit 0926be9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions js/reveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ var Reveal = (function(){
*/
function setPreviousVerticalIndex( stack, v ) {

if( stack ) {
if( typeof stack === 'object' && typeof stack.setAttribute === 'function' ) {
stack.setAttribute( 'data-previous-indexv', v || 0 );
}

Expand All @@ -733,7 +733,7 @@ var Reveal = (function(){
*/
function getPreviousVerticalIndex( stack ) {

if( stack && stack.classList.contains( 'stack' ) ) {
if( typeof stack === 'object' && typeof stack.setAttribute === 'function' && stack.classList.contains( 'stack' ) ) {
return parseInt( stack.getAttribute( 'data-previous-indexv' ) || 0, 10 );
}

Expand Down
Loading

0 comments on commit 0926be9

Please sign in to comment.