Skip to content

Commit f6677ba

Browse files
committed
[clang-tidy] Fix bugprone-unchecked-optional-access in ExceptionAnalyzer
1 parent 395da75 commit f6677ba

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,9 @@ static bool isQualificationConvertiblePointer(QualType From, QualType To,
304304
"From pointer or array has no pointee or element!");
305305
assert(ToPointeeOrElem && "To pointer or array has no pointee or element!");
306306

307+
if (!FromPointeeOrElem || !ToPointeeOrElem)
308+
return false;
309+
307310
From = *FromPointeeOrElem;
308311
To = *ToPointeeOrElem;
309312
}

0 commit comments

Comments
 (0)