| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e365814 commit 6551bb3
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -234,16 +234,16 @@ void UDPWrap::BufferSize(const FunctionCallbackInfo<Value>& args) { | |||
| 234 | 234 | ||
| 235 | 235 | CHECK(args[0]->IsUint32()); | |
| 236 | 236 | CHECK(args[1]->IsUint32()); | |
| 237 | - int size = static_cast<int>(args[0].As<Uint32>()->Value()); | ||
| 238 | 237 | ||
| 239 | - if (size != args[0].As<Uint32>()->Value()) { | ||
| 238 | + if (!args[0]->IsInt32()) { | ||
| 240 | 239 | if (args[1].As<Uint32>()->Value() == 0) | |
| 241 | 240 | return env->ThrowUVException(EINVAL, "uv_recv_buffer_size"); | |
| 242 | 241 | else | |
| 243 | 242 | return env->ThrowUVException(EINVAL, "uv_send_buffer_size"); | |
| 244 | 243 | } | |
| 245 | 244 | ||
| 246 | 245 | int err; | |
| 246 | + int size = static_cast<int>(args[0].As<Uint32>()->Value()); | ||
| 247 | 247 | if (args[1].As<Uint32>()->Value() == 0) { | |
| 248 | 248 | err = uv_recv_buffer_size(reinterpret_cast<uv_handle_t*>(&wrap->handle_), | |
| 249 | 249 | &size); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments