From de4cc6459b2e16a4a78b12452832638158b9ad20 Mon Sep 17 00:00:00 2001 From: xiaoyaobing Date: Fri, 5 Mar 2021 11:15:59 +0800 Subject: [PATCH] qqmldomtop: Change the order of judgment, first judge whether the pointer is empty --- src/qmldom/qqmldomtop.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qmldom/qqmldomtop.cpp b/src/qmldom/qqmldomtop.cpp index 57259c1659f..a295e430586 100644 --- a/src/qmldom/qqmldomtop.cpp +++ b/src/qmldom/qqmldomtop.cpp @@ -251,7 +251,7 @@ QPair>,std::shared_ptr>> { QMutexLocker l(mutex); auto it = map.find(canonicalPath); - if (it != map.cend() && (*it) && (*it)->current) { + if ((*it) && it != map.cend() && (*it)->current) { oldValue = *it; QString oldCode = oldValue->current->code(); QString newCode = newItem->code();