sw/source/core/edit/edfcol.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
New commits: commit caf97c68afc35a8c9a60dd86bf7df205e635bf53 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Mar 19 14:21:20 2021 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Mar 19 21:04:13 2021 +0100 cid#1473777 silence Using invalid iterator Change-Id: I6fd80c8b5cec6d1d9c398e45cbd30cc65caa23a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112749 Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> 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)) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits