Bug 699703 - Part 2. SetSelectionAfterTableEdit should check whether editor is destroyed. r?masayuki draft
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Tue, 01 Aug 2017 16:34:17 +0900
changeset 618925 6879ec0a9a42a9cba38a85b98a2fb347ccafaba1
parent 618922 2578fb9f793550eb654192961f3ed49ca710fdaa
child 640229 a5ff55ead2dd3b3e88bf7f0616f71fc781235013
push id71503
push userbmo:m_kato@ga2.so-net.ne.jp
push dateTue, 01 Aug 2017 08:31:58 +0000
reviewersmasayuki
bugs699703
milestone56.0a1
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
editor/libeditor/HTMLTableEditor.cpp
--- 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;