diff options
Diffstat (limited to 'Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp')
-rw-r--r-- | Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp index 9e89ce8..3d64edd 100644 --- a/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp +++ b/Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp @@ -59,7 +59,10 @@ static v8::Handle<v8::Value> getItem(HTMLCollection* collection, v8::Handle<v8:: { v8::Local<v8::Uint32> index = argument->ToArrayIndex(); if (index.IsEmpty()) { - v8::Handle<v8::Value> result = getNamedItems(collection, toWebCoreString(argument->ToString())); + v8::Local<v8::String> asString = argument->ToString(); + if (asString.IsEmpty()) + return v8::Handle<v8::Value>(); + v8::Handle<v8::Value> result = getNamedItems(collection, toWebCoreString(asString)); if (result.IsEmpty()) return v8::Undefined(); |