| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 097d898 commit 9046e78
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -63,7 +63,10 @@ using v8::HandleScope; | |||
| 63 | 63 | using v8::Int32; | |
| 64 | 64 | using v8::Integer; | |
| 65 | 65 | using v8::Isolate; | |
| 66 | + using v8::Just; | ||
| 66 | 67 | using v8::Local; | |
| 68 | + using v8::Maybe; | ||
| 69 | + using v8::Nothing; | ||
| 67 | 70 | using v8::Null; | |
| 68 | 71 | using v8::Object; | |
| 69 | 72 | using v8::String; | |
@@ -1443,7 +1446,7 @@ void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) { | |||
| 1443 | 1446 | if (status == 0) { | |
| 1444 | 1447 | Local<Array> results = Array::New(env->isolate()); | |
| 1445 | 1448 | ||
| 1446 | - auto add = [&] (bool want_ipv4, bool want_ipv6) { | ||
| 1449 | + auto add = [&] (bool want_ipv4, bool want_ipv6) -> Maybe<bool> { | ||
| 1447 | 1450 | for (auto p = res; p != nullptr; p = p->ai_next) { | |
| 1448 | 1451 | CHECK_EQ(p->ai_socktype, SOCK_STREAM); | |
| 1449 | 1452 | ||
@@ -1463,14 +1466,19 @@ void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) { | |||
| 1463 | 1466 | continue; | |
| 1464 | 1467 | ||
| 1465 | 1468 | Local<String> s = OneByteString(env->isolate(), ip); | |
| 1466 | - results->Set(env->context(), n, s).Check(); | ||
| 1469 | + if (results->Set(env->context(), n, s).IsNothing()) | ||
| 1470 | + return Nothing<bool>(); | ||
| 1467 | 1471 | n++; | |
| 1468 | 1472 | } | |
| 1473 | + return Just(true); | ||
| 1469 | 1474 | }; | |
| 1470 | 1475 | ||
| 1471 | - add(true, verbatim); | ||
| 1472 | - if (verbatim == false) | ||
| 1473 | - add(false, true); | ||
| 1476 | + if (add(true, verbatim).IsNothing()) | ||
| 1477 | + return; | ||
| 1478 | + if (verbatim == false) { | ||
| 1479 | + if (add(false, true).IsNothing()) | ||
| 1480 | + return; | ||
| 1481 | + } | ||
| 1474 | 1482 | ||
| 1475 | 1483 | // No responses were found to return | |
| 1476 | 1484 | if (n == 0) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments