diff --git a/lib/raptor-widgets-browser.js b/lib/raptor-widgets-browser.js index 898a8c0c2..3a8b1b6fd 100644 --- a/lib/raptor-widgets-browser.js +++ b/lib/raptor-widgets-browser.js @@ -36,7 +36,7 @@ exports.get = function (id) { } var node = typeof id === 'string' ? document.getElementById(id) : id; - return node.__widget || null; + return (node && node.__widget) || null; }; exports.initAllWidgets = function() { initWidgets.initServerRendered(true /* scan DOM */);