File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,10 @@ bool VariantUtilities::VariantIsElement(VARIANT value) {
7979}
8080
8181bool VariantUtilities::VariantIsArray (VARIANT value) {
82+ if (value.vt != VT_DISPATCH) {
83+ return false ;
84+ }
85+
8286 std::wstring type_name = GetVariantObjectTypeName (value);
8387
8488 // If the name is DispStaticNodeList, we can be pretty sure it's an array
@@ -97,7 +101,7 @@ bool VariantUtilities::VariantIsArray(VARIANT value) {
97101 // Closure library.
98102 // IMPORTANT: Using this script, user-defined objects with a length
99103 // property defined will be seen as arrays instead of objects.
100- if (type_name == L" JScriptTypeInfo" ) {
104+ if (type_name == L" JScriptTypeInfo" || type_name == L" " ) {
101105 LOG (DEBUG) << " Result type is JScriptTypeInfo" ;
102106 LPOLESTR length_property_name = L" length" ;
103107 DISPID dispid_length = 0 ;
@@ -115,6 +119,9 @@ bool VariantUtilities::VariantIsArray(VARIANT value) {
115119}
116120
117121bool VariantUtilities::VariantIsObject (VARIANT value) {
122+ if (value.vt != VT_DISPATCH) {
123+ return false ;
124+ }
118125 std::wstring type_name = GetVariantObjectTypeName (value);
119126 if (type_name == L" JScriptTypeInfo" ) {
120127 return true ;
You can’t perform that action at this time.
0 commit comments