Permalink
Browse files

Fixes #1: prevent errors when attempting to remove rows from an empty…

… table.
  • Loading branch information...
1 parent b79810e commit d5e1f84b8471388abbdabf65b67b87f750d6070d @reednj committed Aug 28, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 Source/jsTable.js
View
@@ -133,6 +133,10 @@ var jsTable = new Class({
},
deleteRow: function(row_index) {
+ if(row_index < 0 || row_index > this.data.length - 1) {
+ return;
+ }
+
var row_data = this.data[row_index];
var row_id = this.row_list[row_index];
var tr_id = this._getRowElementId(row_id);

0 comments on commit d5e1f84

Please sign in to comment.