From 201886e9ba30c9e89c3cb0ccf1fbaf566e0845f9 2014-01-22 00:28:26
From: Jonathan Frederic <jdfreder@calpoly.edu>
Date: 2014-01-22 00:28:26
Subject: [PATCH] Explicitly return null if there aren't any results

---

diff --git a/IPython/html/static/notebook/js/widgetmanager.js b/IPython/html/static/notebook/js/widgetmanager.js
index 6b3dfa5..d0e6a11 100644
--- a/IPython/html/static/notebook/js/widgetmanager.js
+++ b/IPython/html/static/notebook/js/widgetmanager.js
@@ -77,7 +77,7 @@
                     " message was from.  Widget will not be displayed");
             } else {
                 var view = this.create_view(model, {cell: cell});
-                if (view === undefined) {
+                if (view === null) {
                     console.error("View creation failed", model);
                 }
                 if (cell.widget_subarea !== undefined
@@ -101,6 +101,7 @@
                 model.on('destroy', view.remove, view);
                 return view;
             }
+            return null;
         },
 
         WidgetManager.prototype.get_msg_cell = function (msg_id) {