Fix for bug 76447; test for nsIFilePicker::returnOK to avoid JS error when

the user has pressed cancel; r=morse, sr=blake
This commit is contained in:
law%netscape.com 2001-10-12 23:59:04 +00:00
parent f28a335e3c
commit cd461b49dc

View File

@ -149,11 +149,12 @@
filePicker.appendFilter(programsFilter, "*.exe; *.com");
else
filePicker.appendFilters(FP.filterAll);
filePicker.show();
var file = filePicker.file.QueryInterface(Components.interfaces.nsILocalFile);
gAppPath.value = file.path;
gAppPath.select();
selectAppRadio();
if ( filePicker.show() == FP.returnOK ) {
var file = filePicker.file.QueryInterface(Components.interfaces.nsILocalFile);
gAppPath.value = file.path;
gAppPath.select();
selectAppRadio();
}
}
}