diff options
Diffstat (limited to 'fpdfsdk/src/javascript/Document.cpp')
-rw-r--r-- | fpdfsdk/src/javascript/Document.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp index 7f078e5a5e..1e8d4fde8f 100644 --- a/fpdfsdk/src/javascript/Document.cpp +++ b/fpdfsdk/src/javascript/Document.cpp @@ -1408,8 +1408,12 @@ FX_BOOL Document::addIcon(IFXJS_Context* cc, sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); return FALSE; } - CFX_WideString swIconName = params[0].ToCFXWideString(); + + if (params[1].GetType() != VT_object) { + sError = JSGetStringFromID(pContext, IDS_STRING_JSTYPEERROR); + return FALSE; + } JSFXObject pJSIcon = params[1].ToV8Object(); CJS_Runtime* pRuntime = pContext->GetJSRuntime(); |