mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
OverrideSpecifier: Check for null before dereferencing
This commit is contained in:
committed by
chriseth
parent
d393624384
commit
3a8a74cbc7
@@ -225,13 +225,12 @@ struct OverrideSpecifierChecker: public PostTypeChecker::Checker
|
||||
if (dynamic_cast<ContractDefinition const*>(decl))
|
||||
continue;
|
||||
|
||||
TypeType const* actualTypeType = dynamic_cast<TypeType const*>(decl->type());
|
||||
|
||||
auto const* typeType = dynamic_cast<TypeType const*>(decl->type());
|
||||
m_errorReporter.typeError(
|
||||
9301_error,
|
||||
override->location(),
|
||||
"Expected contract but got " +
|
||||
actualTypeType->actualType()->toString(true) +
|
||||
(typeType ? typeType->actualType() : decl->type())->toString(true) +
|
||||
"."
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user