From 2474a3b2d9fe987dac58813771f1fa66427e124f Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Tue, 24 Oct 2017 21:50:21 -0400 Subject: Only set return value if one provided This CL updates the javascript methods to only set the return value if the v8::Local is not empty. Change-Id: I1e0cac2d024671c3e217cb1b2292c40ed62484a4 Reviewed-on: https://pdfium-review.googlesource.com/16731 Reviewed-by: Tom Sepez Commit-Queue: dsinclair --- fpdfsdk/javascript/JS_Define.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/javascript/JS_Define.h b/fpdfsdk/javascript/JS_Define.h index 819cc9c25e..39346135c5 100644 --- a/fpdfsdk/javascript/JS_Define.h +++ b/fpdfsdk/javascript/JS_Define.h @@ -58,7 +58,8 @@ void JSPropGetter(const char* prop_name_string, JSFormatErrorString(class_name_string, prop_name_string, sError)); return; } - info.GetReturnValue().Set(prop_value.ToV8Value()); + if (!prop_value.ToV8Value().IsEmpty()) + info.GetReturnValue().Set(prop_value.ToV8Value()); } template