diff --git a/IPython/html/static/notebook/js/codecell.js b/IPython/html/static/notebook/js/codecell.js
index 8ae55b5..ae0afda 100644
--- a/IPython/html/static/notebook/js/codecell.js
+++ b/IPython/html/static/notebook/js/codecell.js
@@ -278,6 +278,11 @@ define([
* @method execute
*/
CodeCell.prototype.execute = function () {
+ if (!this.kernel || !this.kernel.is_connected()) {
+ console.log("Can't execute, kernel is not connected.");
+ return;
+ }
+
this.output_area.clear_output();
// Clear widget area