From 49845b92afdb73f4d3edc07152985331e4de9395 Mon Sep 17 00:00:00 2001 From: Cedric GESTES Date: Thu, 12 Feb 2015 14:25:48 +0100 Subject: [PATCH] get_body_data: fix for undefined return undefined instead of "undefined" --- IPython/html/static/base/js/utils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/IPython/html/static/base/js/utils.js b/IPython/html/static/base/js/utils.js index 32123bf88..c4659ab71 100644 --- a/IPython/html/static/base/js/utils.js +++ b/IPython/html/static/base/js/utils.js @@ -483,7 +483,10 @@ define([ * we should never have any encoded URLs anywhere else in code * until we are building an actual request */ - return decodeURIComponent($('body').data(key)); + var val = $('body').data(key); + if (!val) + return val; + return decodeURIComponent(val); }; var to_absolute_cursor_pos = function (cm, cursor) {