Handle empty handles (#11598)

* Handle empty handles

* Close and dispose window at end of void test

* Dispose of existing window before running void 0 spec
This commit is contained in:
Samuel Attard 2018-02-13 06:46:29 +11:00 committed by shelley vohr
parent 181169b743
commit 9bd7d53cf8
3 changed files with 23 additions and 10 deletions

View file

@ -340,7 +340,7 @@ WebContents::WebContents(v8::Isolate* isolate, const mate::Dictionary& options)
// Obtain the session.
std::string partition;
mate::Handle<api::Session> session;
if (options.Get("session", &session)) {
if (options.Get("session", &session) && !session.IsEmpty()) {
} else if (options.Get("partition", &partition)) {
session = Session::FromPartition(isolate, partition);
} else {