Bug 880042 - file[multiple] form field nsIFilePicker crash if overriding component has not implemented a domfiles getter. r=smaug
authorAndrea Marchesini <amarchesini@mozilla.com>
Tue, 11 Jun 2013 15:09:49 -0400
changeset 134693 9b4cad5ad857f6602bccbfc8b0dbfe93fc2aef24
parent 134692 eeb959ae733f86101c54cc5fb6ff1e94b0cf3723
child 134694 cf1461d6234c1122e9f499433a86d87b1d5de3c6
child 134702 cc35f8929768bf4bf2d9e2f824c8553ae3863d67
push id29339
push userryanvm@gmail.com
push dateWed, 12 Jun 2013 00:52:38 +0000
treeherdermozilla-inbound@9b4cad5ad857 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs880042
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 880042 - file[multiple] form field nsIFilePicker crash if overriding component has not implemented a domfiles getter. r=smaug
content/html/content/src/HTMLInputElement.cpp
--- a/content/html/content/src/HTMLInputElement.cpp
+++ b/content/html/content/src/HTMLInputElement.cpp
@@ -319,16 +319,20 @@ HTMLInputElement::nsFilePickerShownCallb
 
   // Collect new selected filenames
   nsCOMArray<nsIDOMFile> newFiles;
   if (mMulti) {
     nsCOMPtr<nsISimpleEnumerator> iter;
     nsresult rv = mFilePicker->GetDomfiles(getter_AddRefs(iter));
     NS_ENSURE_SUCCESS(rv, rv);
 
+    if (!iter) {
+      return NS_OK;
+    }
+
     nsCOMPtr<nsISupports> tmp;
     bool prefSaved = false;
     bool loop = true;
 
     while (NS_SUCCEEDED(iter->HasMoreElements(&loop)) && loop) {
       iter->GetNext(getter_AddRefs(tmp));
       nsCOMPtr<nsIDOMFile> domFile = do_QueryInterface(tmp);
       MOZ_ASSERT(domFile);