Utils: Fix toggling the "enabled" status

... of the first entry in a list of environment variables.
Commit 727be63dac changed an assertion
from testing against end() to begin(), which was likely unintended.

Task-number: QTCREATORBUG-32495
Change-Id: I7814018d914219b4aebff70ab4aa6f185dbfcff0
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Christian Kandeler
2025-02-18 10:46:45 +01:00
parent 1a5198d88c
commit f93da92893

View File

@@ -356,7 +356,7 @@ void EnvironmentModel::toggleVariable(const QModelIndex &idx)
{
const QString name = indexToVariable(idx);
const auto newIt = d->m_resultNameValueDictionary.find(name);
QTC_ASSERT(newIt != d->m_resultNameValueDictionary.begin(), return);
QTC_ASSERT(newIt != d->m_resultNameValueDictionary.end(), return);
const auto op = newIt.enabled() ? EnvironmentItem::SetDisabled : EnvironmentItem::SetEnabled;
const int changesPos = d->findInChanges(name);
if (changesPos != -1) {