From 47a79e2225295a85890c67b7bd40fc30e73ce338 Mon Sep 17 00:00:00 2001
From: Tobias Hunger <tobias.hunger@nokia.com>
Date: Thu, 28 Jun 2012 21:29:46 +0200
Subject: [PATCH] Fix possible crash when checking sysroot

Change-Id: I556ef0db09ceedd32e005b7057c56629d6fda5ec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
---
 src/plugins/projectexplorer/profileinformation.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/plugins/projectexplorer/profileinformation.cpp b/src/plugins/projectexplorer/profileinformation.cpp
index 963ed319446..242ecae8c04 100644
--- a/src/plugins/projectexplorer/profileinformation.cpp
+++ b/src/plugins/projectexplorer/profileinformation.cpp
@@ -102,7 +102,9 @@ ProfileInformation::ItemList SysRootProfileInformation::toUserOutput(Profile *p)
 
 bool SysRootProfileInformation::hasSysRoot(const Profile *p)
 {
-    return !p->value(Core::Id(SYSROOT_INFORMATION)).toString().isEmpty();
+    if (p)
+        return !p->value(Core::Id(SYSROOT_INFORMATION)).toString().isEmpty();
+    return false;
 }
 
 Utils::FileName SysRootProfileInformation::sysRoot(const Profile *p)
-- 
GitLab