Fix nullderef when ConstantReference::Resolve fails
This is a regression due to aosp/1538630.
Bug: 176888762
Test: aidl_unittests
Change-Id: I3e608f128ecc3bf5b58db4e90069c70293536e5b
diff --git a/aidl_const_expressions.cpp b/aidl_const_expressions.cpp
index 726da1d..ce236fe 100644
--- a/aidl_const_expressions.cpp
+++ b/aidl_const_expressions.cpp
@@ -776,7 +776,7 @@
}
}
}
- AIDL_ERROR(*this) << "Can't find " << field_name_ << " in " << ref_type_->GetName();
+ AIDL_ERROR(*this) << "Can't find " << field_name_ << " in " << defined_type->GetName();
return nullptr;
}