diff --git replace/tabledrag.js replace/tabledrag.js
index a64b9a7..11fa007 100644
--- replace/tabledrag.js
+++ replace/tabledrag.js
@@ -127,7 +127,7 @@ Drupal.tableDrag.prototype.hideColumns = function(){
         });
         if (index > 0) {
           cell = row.children(':nth-child(' + index + ')');
-          if (cell[0].colSpan > 1) {
+          if (cell.length > 0 && cell[0].colSpan > 1) {
             // If this cell has a colspan, simply reduce it.
             cell[0].colSpan = cell[0].colSpan - 1;
           }
