Revision: 3043
Author: [email protected]
Date: Fri Oct  9 01:21:56 2009
Log: Add missing null check in Context::GetCurrent.
Review URL: http://codereview.chromium.org/272007
http://code.google.com/p/v8/source/detail?r=3043

Modified:
  /branches/bleeding_edge/src/api.cc

=======================================
--- /branches/bleeding_edge/src/api.cc  Thu Oct  8 05:36:12 2009
+++ /branches/bleeding_edge/src/api.cc  Fri Oct  9 01:21:56 2009
@@ -2760,7 +2760,9 @@

  v8::Local<v8::Context> Context::GetCurrent() {
    if (IsDeadCheck("v8::Context::GetCurrent()")) return Local<Context>();
-  i::Handle<i::Context> context(i::Top::global_context());
+  i::Handle<i::Object> current = i::Top::global_context();
+  if (current.is_null()) return Local<Context>();
+  i::Handle<i::Context> context = i::Handle<i::Context>::cast(current);
    return Utils::ToLocal(context);
  }


--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to