fix out of bounds column widths
authorAlan <alan@roojs.com>
Thu, 18 Jan 2024 08:36:23 +0000 (16:36 +0800)
committerAlan <alan@roojs.com>
Thu, 18 Jan 2024 08:36:23 +0000 (16:36 +0800)
Roo/htmleditor/BlockTd.js

index 3f37011..6bda2c3 100644 (file)
@@ -684,7 +684,11 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, {
                  this.colWidths[i] = nw;
                 return;
             }
-            this.colWidths[i] += otherAdd
+            if (typeof(this.colWidths[i]) == 'undefined') {
+                this.colWidths[i] = otherAdd;
+            } else {
+                this.colWidths[i] += otherAdd;
+            }
         }, this);
         this.updateWidths(table);
          
@@ -704,7 +708,12 @@ Roo.extend(Roo.htmleditor.BlockTd, Roo.htmleditor.Block, {
                 this.colWidths[i] = nw;
                 return;
             }
-            this.colWidths[i] -= otherSub
+            if (typeof(this.colWidths[i]) == 'undefined') {
+                this.colWidths[i] = otherSub;
+            } else {
+                this.colWidths[i] -= otherSub;
+            }
+            
         }, this);
         this.updateWidths(table);