diff options
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/edit/edfcol.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index ed6e90b12ede..bcff20b8b243 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -1946,6 +1946,7 @@ void SwEditShell::RestoreMetadataFieldsAndValidateParagraphSignatures() std::vector<svx::ClassificationResult> aResults; if (!sFieldNames.isEmpty()) { + assert(it != aStatements.end() && "can only be non-empty if it was valid"); // Order the fields sal_Int32 nIndex = 0; do @@ -1955,8 +1956,9 @@ void SwEditShell::RestoreMetadataFieldsAndValidateParagraphSignatures() break; const auto it2 = aStatements.find(sCurFieldName); - const OUString sName = (it2 != aStatements.end() ? it->first : sBlank); - const OUString sValue = (it2 != aStatements.end() ? it->second : sBlank); + bool bStatementFound = it2 != aStatements.end(); + const OUString sName = bStatementFound ? it->first : sBlank; + const OUString sValue = bStatementFound ? it->second : sBlank; if (aKeyCreator.isMarkingTextKey(sName)) { |