aboutsummaryrefslogtreecommitdiffhomepage
path: root/js/reveal.js
diff options
context:
space:
mode:
authorHakim El Hattab2013-03-04 17:01:49 -0500
committerHakim El Hattab2013-03-04 17:01:49 -0500
commit0926be9781ee2a9dddb87633c832023d188cac7d (patch)
treea2179b6fb7321d6177f5ceae31e66c40469932e2 /js/reveal.js
parent3bae233289b50bb811c1c9b19ad882944769e9b5 (diff)
better null check for stack (closes #354)
Diffstat (limited to 'js/reveal.js')
-rw-r--r--js/reveal.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 65ba58d..664fc90 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -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 );
}
@@ -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 );
}