[CFE] Check 'instrumentation != null' before doing other calls

Change-Id: I81f562824b8011d5a99e334daeeede36e6650b03
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/298560
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
Jens Johansen 2023-04-26 12:19:47 +00:00 committed by Commit Queue
parent 43b499cf9a
commit ad87701920

View file

@ -1373,7 +1373,8 @@ abstract class InferenceVisitorBase implements InferenceVisitor {
ObjectAccessTarget target =
objectAccessDescriptor.findNonExtensionTarget(this);
if (instrumented &&
if (instrumentation != null &&
instrumented &&
receiverBound != const DynamicType() &&
(target.isInstanceMember || target.isObjectMember)) {
instrumentation?.record(uriForInstrumentation, fileOffset, 'target',