Index: src/messages.cc |
diff --git a/src/messages.cc b/src/messages.cc |
index 23deb1afebaacfee3d641b75c3fd7d38e612bda1..0365ec88021e0149bb894e565bbf17f6d4fdd3d9 100644 |
--- a/src/messages.cc |
+++ b/src/messages.cc |
@@ -223,9 +223,12 @@ bool CheckMethodName(Isolate* isolate, Handle<JSObject> obj, Handle<Name> name, |
Handle<Object> CallSite::GetMethodName() { |
- MaybeHandle<JSReceiver> maybe = Object::ToObject(isolate_, receiver_); |
- Handle<JSReceiver> receiver; |
- if (!maybe.ToHandle(&receiver) || !receiver->IsJSObject()) { |
+ if (receiver_->IsNull() || receiver_->IsUndefined()) { |
+ return isolate_->factory()->null_value(); |
+ } |
+ Handle<JSReceiver> receiver = |
+ Object::ToObject(isolate_, receiver_).ToHandleChecked(); |
+ if (!receiver->IsJSObject()) { |
return isolate_->factory()->null_value(); |
} |