Bug 1530250 - Make InsertTagCommand::DoCommandParams() check result of nsCommandParams::GetString() r=m_kato
authorMasayuki Nakano <masayuki@d-toybox.com>
Wed, 27 Feb 2019 00:44:18 +0000
changeset 519276 d954c8365626fc7dac127fd9c464f1008b9b06ba
parent 519275 ae89133ff9bd067f8b7d1d619f3c85bd5659fb2c
child 519277 57545823008093781ee9812e3feb4afe4a5f0893
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersm_kato
bugs1530250, 1529190
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1530250 - Make InsertTagCommand::DoCommandParams() check result of nsCommandParams::GetString() r=m_kato Accidentally, I removed the check in the previous landing (bug 1529190). This patch restores it. Differential Revision: https://phabricator.services.mozilla.com/D20970
editor/libeditor/HTMLEditorCommands.cpp
--- a/editor/libeditor/HTMLEditorCommands.cpp
+++ b/editor/libeditor/HTMLEditorCommands.cpp
@@ -1404,16 +1404,19 @@ InsertTagCommand::DoCommandParams(const 
     return NS_ERROR_FAILURE;
   }
 
   // Don't use nsAutoString here because nsCommandParams stores string member
   // with nsString*.  Therefore, nsAutoString always needs to copy the storage
   // but nsString may avoid it.
   nsString value;
   nsresult rv = aParams->AsCommandParams()->GetString(STATE_ATTRIBUTE, value);
+  if (NS_WARN_IF(NS_FAILED(rv))) {
+    return rv;
+  }
   if (NS_WARN_IF(value.IsEmpty())) {
     return NS_ERROR_INVALID_ARG;
   }
 
   // filter out tags we don't know how to insert
   nsAtom* attribute = nullptr;
   if (mTagName == nsGkAtoms::a) {
     attribute = nsGkAtoms::href;