Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Unified Diff: gin/handle.h

Issue 184253004: gin: Bug fix: Fix CreateHandle to return an emtpy handle in some extreme cases (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Bug fix: remove an extra include Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gin/wrappable.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/handle.h
diff --git a/gin/handle.h b/gin/handle.h
index da1de347f230a53080ae41b048d9885865881318..01db6606f194892e909bbcc8726d48452675bbaa 100644
--- a/gin/handle.h
+++ b/gin/handle.h
@@ -60,7 +60,10 @@ struct Converter<gin::Handle<T> > {
// without having to write out the type of the object explicitly.
template<typename T>
gin::Handle<T> CreateHandle(v8::Isolate* isolate, T* object) {
- return gin::Handle<T>(object->GetWrapper(isolate), object);
+ v8::Handle<v8::Object> wrapper = object->GetWrapper(isolate);
+ if (wrapper.IsEmpty())
+ return gin::Handle<T>();
+ return gin::Handle<T>(wrapper, object);
}
} // namespace gin
« no previous file with comments | « no previous file | gin/wrappable.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698