Commit 31bc8ecd by Adeel

Code: Rescue from throwing. (#362)

parent e5484342
...@@ -20,6 +20,9 @@ void WorkOnContext(uv_work_t* req) { ...@@ -20,6 +20,9 @@ void WorkOnContext(uv_work_t* req) {
} }
char* CreateString(Local<Value> value) { char* CreateString(Local<Value> value) {
if(value->IsNull() || !value->IsString()) {
return const_cast<char*>(""); // return empty string.
}
size_t count; size_t count;
return NanCString(value, &count); return NanCString(value, &count);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment