forked from qt-creator/qt-creator
CPlusPlus: Avoid nullptr access
Task-number: QTCREATORBUG-18903 Change-Id: I852b5de453d44c16adffd44c89900cfb8c3cc522 Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
6
src/libs/3rdparty/cplusplus/Symbols.cpp
vendored
6
src/libs/3rdparty/cplusplus/Symbols.cpp
vendored
@@ -106,7 +106,11 @@ Declaration::Declaration(Clone *clone, Subst *subst, Declaration *original)
|
|||||||
, _initializer(clone->stringLiteral(original->_initializer))
|
, _initializer(clone->stringLiteral(original->_initializer))
|
||||||
{
|
{
|
||||||
const char* nameId = nullptr;
|
const char* nameId = nullptr;
|
||||||
if (const Identifier* identifier = name()->identifier())
|
const Name *theName = name();
|
||||||
|
if (!theName)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (const Identifier* identifier = theName->identifier())
|
||||||
nameId = identifier->chars();
|
nameId = identifier->chars();
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user