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 2006-05-17 02:31:21 +00:00
Родитель 5ffb5a39e1
Коммит 812995d720
1 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -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();
}
}
}