diff --git a/editor/libeditor/base/crashtests/407256-1.html b/editor/libeditor/base/crashtests/407256-1.html new file mode 100644 index 00000000000..824162ac56a --- /dev/null +++ b/editor/libeditor/base/crashtests/407256-1.html @@ -0,0 +1,23 @@ + + + + + + + + diff --git a/editor/libeditor/base/crashtests/crashtests.list b/editor/libeditor/base/crashtests/crashtests.list new file mode 100644 index 00000000000..48082908f77 --- /dev/null +++ b/editor/libeditor/base/crashtests/crashtests.list @@ -0,0 +1 @@ +load 407256-1.html diff --git a/editor/libeditor/base/nsEditorUtils.cpp b/editor/libeditor/base/nsEditorUtils.cpp index 70447a2b462..479fab21fa5 100644 --- a/editor/libeditor/base/nsEditorUtils.cpp +++ b/editor/libeditor/base/nsEditorUtils.cpp @@ -71,6 +71,7 @@ mSel(nsnull) nsAutoSelectionReset::~nsAutoSelectionReset() { + NS_ASSERTION(!mSel || mEd, "mEd should be non-null when mSel is"); if (mSel && mEd->ArePreservingSelection()) // mSel will be null if this was nested call { mEd->RestorePreservedSelection(mSel); @@ -80,7 +81,9 @@ nsAutoSelectionReset::~nsAutoSelectionReset() void nsAutoSelectionReset::Abort() { - mEd->StopPreservingSelection(); + NS_ASSERTION(!mSel || mEd, "mEd should be non-null when mSel is"); + if (mSel) + mEd->StopPreservingSelection(); } diff --git a/testing/crashtest/crashtests.list b/testing/crashtest/crashtests.list index a20c9eb8987..1af8885d5eb 100644 --- a/testing/crashtest/crashtests.list +++ b/testing/crashtest/crashtests.list @@ -21,6 +21,7 @@ include ../../dom/src/offline/crashtests/crashtests.list include ../../dom/src/jsurl/crashtests/crashtests.list include ../../editor/libeditor/html/crashtests/crashtests.list +include ../../editor/libeditor/base/crashtests/crashtests.list include ../../js/src/xpconnect/crashtests/crashtests.list