From d98ee357d41b34a0cffd3da2adba6b460854b1c6 Mon Sep 17 00:00:00 2001 From: PKEuS Date: Mon, 3 Sep 2012 11:30:36 +0200 Subject: [PATCH] Fixed crash #4135 when using Q_DECLARE_METATYPE --- lib/checkother.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index e5b9767b7..18b86f43b 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -394,7 +394,7 @@ void CheckOther::invalidPointerCast() if (Token::Match(tok, "( const| %type% const| * )") || Token::Match(tok, "( const| %type% %type% const| * )")) { toTok = tok->next(); nextTok = tok->link()->next(); - if (nextTok->str() == "(") + if (nextTok && nextTok->str() == "(") nextTok = nextTok->next(); } else if (Token::Match(tok, "reinterpret_cast < const| %type% const| * > (") || Token::Match(tok, "reinterpret_cast < const| %type% %type% const| * > (")) { nextTok = tok->tokAt(5);