mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-27 10:50:35 +00:00
CCK only - add some error checking for a weird edge case
This commit is contained in:
parent
3b59e14a39
commit
c80aa2a68a
@ -1917,6 +1917,24 @@ function InitConfigInfo()
|
||||
function CCKWriteConfigFile(destdir)
|
||||
{
|
||||
var file = destdir.clone();
|
||||
if (!file.exists()) {
|
||||
var bundle = document.getElementById("bundle_cckwizard");
|
||||
var button = gPromptService.confirmEx(window, bundle.getString("windowTitle"), bundle.getString("createDir").replace(/%S/g, file.path),
|
||||
gPromptService.BUTTON_TITLE_YES * gPromptService.BUTTON_POS_0 +
|
||||
gPromptService.BUTTON_TITLE_NO * gPromptService.BUTTON_POS_1,
|
||||
null, null, null, null, {});
|
||||
if (button == 0) {
|
||||
try {
|
||||
file.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0775);
|
||||
} catch (ex) {
|
||||
gPromptService.alert(window, bundle.getString("windowTitle"),
|
||||
bundle.getString("createDirError").replace(/%S/g, filename));
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
file.append("cck.config");
|
||||
|
||||
var fos = Components.classes["@mozilla.org/network/file-output-stream;1"]
|
||||
|
Loading…
Reference in New Issue
Block a user