Skip to content

Commit

Permalink
prevent null deference later
Browse files Browse the repository at this point in the history
  • Loading branch information
jhchen committed Jun 28, 2018
1 parent 4e42c08 commit a4f1157
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ class Table extends Module {
getTable(range = this.quill.getSelection()) {
if (range == null) return [null, null, null, -1];
const [cell, offset] = this.quill.getLine(range.index);
if (cell == null) return [null, null, null, -1];
if (cell == null || cell.statics.blotName !== TableCell.blotName) {
return [null, null, null, -1];
}
const row = cell.parent;
const table = row.parent.parent;
return [table, row, cell, offset];
Expand Down

0 comments on commit a4f1157

Please sign in to comment.