Update MainForm.checkForPassword to use TryGetFile

This commit is contained in:
miku-666
2022-08-11 21:47:49 +02:00
parent 768bdc4dc7
commit 18559bcf4d

View File

@@ -124,9 +124,8 @@ namespace PckStudio
private bool checkForPassword()
{
if (currentPCK.HasFile("0", 4))
if (currentPCK.TryGetFile("0", 4, out PCKFile.FileData file))
{
var file = currentPCK.GetFile("0", 4);
if (file.properties.HasProperty("LOCK"))
return new pckLocked(file.properties.GetProperty("LOCK").Item2).ShowDialog() == DialogResult.OK;
}