Bug 880042 - file[multiple] form field nsIFilePicker crash if overriding component has not implemented a domfiles getter. r=smaug
☠☠ backed out by a259e4b7d9ab ☠ ☠
authorAndrea Marchesini <amarchesini@mozilla.com>
Tue, 11 Jun 2013 15:09:49 -0400
changeset 141803 9c6f5f334a15584a1b3749ca55505105d22c6486
parent 141802 149475141471abb3838b8815274ba4e540c0eb14
child 141804 4e0f0d13afd3c731de78aa74625fa6a38a3d9d98
push id3911
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 20:17:26 +0000
treeherdermozilla-aurora@7e26ca8db92b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs880042
milestone24.0a1
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);