Bug 699703 - Part 2. SetSelectionAfterTableEdit should check whether editor is destroyed. r?masayuki
After reframe, SetSelectionAfterTableEdit might be called from RAII class, so we should check whether editor is destroyed.
MozReview-Commit-ID: I4r6kvxgRDZ
--- a/editor/libeditor/HTMLTableEditor.cpp
+++ b/editor/libeditor/HTMLTableEditor.cpp
@@ -3101,16 +3101,20 @@ NS_IMETHODIMP
HTMLEditor::SetSelectionAfterTableEdit(nsIDOMElement* aTable,
int32_t aRow,
int32_t aCol,
int32_t aDirection,
bool aSelected)
{
NS_ENSURE_TRUE(aTable, NS_ERROR_NOT_INITIALIZED);
+ if (Destroyed()) {
+ return NS_ERROR_FAILURE;
+ }
+
RefPtr<Selection> selection = GetSelection();
if (!selection) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIDOMElement> cell;
bool done = false;