diff options
Diffstat (limited to 'fxjs/cjs_color.cpp')
-rw-r--r-- | fxjs/cjs_color.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fxjs/cjs_color.cpp b/fxjs/cjs_color.cpp index bba4513b67..06c61f87d4 100644 --- a/fxjs/cjs_color.cpp +++ b/fxjs/cjs_color.cpp @@ -258,9 +258,12 @@ CJS_Result CJS_Color::GetPropertyHelper(CJS_Runtime* pRuntime, CFX_Color* var) { CJS_Result CJS_Color::SetPropertyHelper(CJS_Runtime* pRuntime, v8::Local<v8::Value> vp, CFX_Color* var) { - if (vp.IsEmpty() || !vp->IsArray()) + if (vp.IsEmpty()) return CJS_Result::Failure(JSMessage::kParamError); + if (!vp->IsArray()) + return CJS_Result::Failure(JSMessage::kTypeError); + *var = ConvertArrayToPWLColor(pRuntime, pRuntime->ToArray(vp)); return CJS_Result::Success(); } |