CMakePM: Fix crash with specific CMakePresets.json

The code was not taking into consideration an empty QStringList.

Fixes: QTCREATORBUG-30755
Change-Id: Ifb9f5dc3ffefd94d44b16b161bc04d381f3f6786
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Cristian Adam
2024-04-29 16:05:02 +02:00
parent 52979e8037
commit 84f0f6ba8b

View File

@@ -136,6 +136,8 @@ Internal::PresetsData CMakeProject::combinePresets(Internal::PresetsData &cmakeP
&& left.inherits.value().contains(right.name);
const bool inheritsGreater = left.inherits && right.inherits
&& !left.inherits.value().isEmpty()
&& !right.inherits.value().isEmpty()
&& left.inherits.value().first()
> right.inherits.value().first();