提交 e7c63eec authored 作者: Christian Schmidt's avatar Christian Schmidt

FS-11552: [mod_v8] Crash when accessing props of dead session

上级 362c5f8b
...@@ -1530,11 +1530,23 @@ JS_SESSION_GET_PROPERTY_IMPL(GetProperty) ...@@ -1530,11 +1530,23 @@ JS_SESSION_GET_PROPERTY_IMPL(GetProperty)
info.GetReturnValue().Set(Integer::New(info.GetIsolate(), this->_cause)); info.GetReturnValue().Set(Integer::New(info.GetIsolate(), this->_cause));
} }
} else if (!strcmp(prop, "name")) { } else if (!strcmp(prop, "name")) {
if (channel) {
info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), switch_channel_get_name(channel))); info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), switch_channel_get_name(channel)));
} else {
info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), ""));
}
} else if (!strcmp(prop, "uuid")) { } else if (!strcmp(prop, "uuid")) {
if (channel) {
info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), switch_channel_get_uuid(channel))); info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), switch_channel_get_uuid(channel)));
} else {
info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), ""));
}
} else if (!strcmp(prop, "state")) { } else if (!strcmp(prop, "state")) {
if (channel) {
info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), switch_channel_state_name(switch_channel_get_state(channel)))); info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), switch_channel_state_name(switch_channel_get_state(channel))));
} else {
info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), ""));
}
} else if (!strcmp(prop, "dialplan")) { } else if (!strcmp(prop, "dialplan")) {
if (caller_profile) { if (caller_profile) {
info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), caller_profile->dialplan)); info.GetReturnValue().Set(String::NewFromUtf8(info.GetIsolate(), caller_profile->dialplan));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论