WebInspector: View throughs the exception when a child view are removed by removeChil...
[WebKit-https.git] / Source / WebCore / inspector / front-end / DatabaseTableView.js
index 576ece356f1e334f80e0ab4497b2aaaab6d56e04..c7b87a20d235cefac7baa20b0c4045e80acc1604 100644 (file)
@@ -59,6 +59,7 @@ WebInspector.DatabaseTableView.prototype = {
 
     _queryFinished: function(columnNames, values)
     {
 
     _queryFinished: function(columnNames, values)
     {
+        this.detachChildViews();
         this.element.removeChildren();
 
         var dataGrid = WebInspector.DataGrid.createSortableDataGrid(columnNames, values);
         this.element.removeChildren();
 
         var dataGrid = WebInspector.DataGrid.createSortableDataGrid(columnNames, values);
@@ -67,13 +68,13 @@ WebInspector.DatabaseTableView.prototype = {
             this._emptyView.show(this.element);
             return;
         }
             this._emptyView.show(this.element);
             return;
         }
-
-        this.element.appendChild(dataGrid.element);
+        dataGrid.show(this.element);
         dataGrid.autoSizeColumns(5);
     },
 
     _queryError: function(error)
     {
         dataGrid.autoSizeColumns(5);
     },
 
     _queryError: function(error)
     {
+        this.detachChildViews();
         this.element.removeChildren();
 
         var errorMsgElement = document.createElement("div");
         this.element.removeChildren();
 
         var errorMsgElement = document.createElement("div");