Skip to content
This repository has been archived by the owner on Jun 18, 2023. It is now read-only.

Commit

Permalink
Fixed issue #2 (Freezing the app when opening a non-existent skin)
Browse files Browse the repository at this point in the history
  • Loading branch information
Piripe committed Sep 1, 2022
1 parent 49ba674 commit 67428d6
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
10 changes: 6 additions & 4 deletions Oxygen/Forms/Welcome.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,13 @@ private void nextButton_Click(object sender, EventArgs e)
}
});

progressDialog.ShowDialog();
if (progressDialog.ShowDialog() == DialogResult.OK)
{

Global.Editor = new Forms.Editor();
Global.Editor.Show();
Close();
Global.Editor = new Forms.Editor();
Global.Editor.Show();
Close();
}
}

private void internetSkinPreviewPictureBox_Click(object sender, EventArgs e)
Expand Down
30 changes: 28 additions & 2 deletions Oxygen/Modules/ProjectManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,34 @@ await Task.Factory.StartNew(() => {
}
else
{
System.IO.Compression.ZipFile.ExtractToDirectory(Global.SkinConfig.skinPath??"", Path.Combine(rootWorkingPath, "skin"));
checkIfValidSkin();
if (File.Exists(Global.SkinConfig.skinPath))
{
try
{
System.IO.Compression.ZipFile.ExtractToDirectory(Global.SkinConfig.skinPath ?? "", Path.Combine(rootWorkingPath, "skin"));
checkIfValidSkin();
}
catch
{
MessageBox.Show("Can't extract the skin.");
Task.Factory.StartNew(() => {
progress.DialogResult = DialogResult.Abort;
}, CancellationToken.None, TaskCreationOptions.None, context);

progress.CLIResult = DialogResult.Abort;
progress.drawCLIProgressbar("Error while importing skin: Can't extract the skin.", 100);
}
}
else
{
MessageBox.Show("Invalid skin.");
Task.Factory.StartNew(() => {
progress.DialogResult = DialogResult.Abort;
}, CancellationToken.None, TaskCreationOptions.None, context);

progress.CLIResult = DialogResult.Abort;
progress.drawCLIProgressbar("Error while importing skin: Invalid skin.", 100);
}
}
}
else
Expand Down

0 comments on commit 67428d6

Please sign in to comment.