File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
test-app/runtime/src/main/cpp/runtime/console Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -87,9 +87,13 @@ std::string transformJSObject(napi_env env, napi_value object) {
8787 napi_is_error (env, object, &is_error);
8888 if (is_error) {
8989 napi_value stack;
90- napi_get_named_property (env, object, " stack" , &stack);
91- auto stack_value = ArgConverter::ConvertToString (env, stack);
92- value += " \n " + stack_value;
90+ napi_status status = napi_get_named_property (env, object, " stack" , &stack);
91+ if (status == napi_ok && !napi_util::is_null_or_undefined (env, stack)) {
92+ auto stack_value = ArgConverter::ConvertToString (env, stack);
93+ if (!stack_value.empty () && value.find (stack_value) == std::string::npos) {
94+ value += " \n " + stack_value;
95+ }
96+ }
9397 }
9498
9599 auto hasCustomToStringImplementation = value.find (" [object Object]" ) == std::string::npos;
You can’t perform that action at this time.
0 commit comments