From ea735f0a2f4983a54bed94e2ce83f6ebe297a225 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Wed, 25 Feb 2015 13:26:45 +0100 Subject: [PATCH] ensure postmessage data is a string #1143 --- js/reveal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/reveal.js b/js/reveal.js index 0e60745..850f431 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -795,7 +795,7 @@ var data = event.data; // Make sure we're dealing with JSON - if( data.charAt( 0 ) === '{' && data.charAt( data.length - 1 ) === '}' ) { + if( typeof data === 'string' && data.charAt( 0 ) === '{' && data.charAt( data.length - 1 ) === '}' ) { data = JSON.parse( data ); // Check if the requested method can be found