Bug 1555640 - Check if aPointAfterInsertedString is nullptr when WSRunObject::InsertText() sets its value r=m_kato

`aPointAfterInsertedString` of `WSRunObject::InsertText()` is optional (i.e.,
may be nullptr).  However, the fix for bug 1534394 makes it always set to
original insertion point when `InsertTextWithTransaction()` is failed.

This patch just make it check if `aPointAfterInsertedString` is nullptr before
setting its value.

Differential Revision: https://phabricator.services.mozilla.com/D33144

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Masayuki Nakano 2019-05-30 10:32:44 +00:00
parent 89fcedf92d
commit a3d946e313

View File

@ -380,7 +380,9 @@ nsresult WSRunObject::InsertText(Document& aDocument,
aPointAfterInsertedString);
if (NS_WARN_IF(NS_FAILED(rv))) {
// XXX Temporarily, set new insertion point to the original point.
*aPointAfterInsertedString = pointToInsert;
if (aPointAfterInsertedString) {
*aPointAfterInsertedString = pointToInsert;
}
return NS_OK;
}
return NS_OK;