From fb99157abd013777392d8cef3231a26deb101d2e Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 4 Dec 2015 12:36:54 +0100 Subject: [PATCH] Core::Id: Handle empty strings passed to fromString() Return Id() in that case. Currently we can convert the invalid Id to a string, but when we try to convert that string back to an Id there is a soft assert. Change-Id: Iad8443ff65a643030bd47446ec2dcf2889d2e4eb Reviewed-by: Eike Ziller --- src/plugins/coreplugin/id.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/coreplugin/id.cpp b/src/plugins/coreplugin/id.cpp index 5a6b9073000..61f61144852 100644 --- a/src/plugins/coreplugin/id.cpp +++ b/src/plugins/coreplugin/id.cpp @@ -201,6 +201,8 @@ QString Id::toString() const Id Id::fromString(const QString &name) { + if (name.isEmpty()) + return Id(); return Id(theId(name.toUtf8())); }