From 18559bcf4d2139a29e058fe9262136d0b10b275a Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Thu, 11 Aug 2022 21:47:49 +0200 Subject: [PATCH] Update `MainForm.checkForPassword` to use `TryGetFile` --- PCK-Studio/MainForm.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PCK-Studio/MainForm.cs b/PCK-Studio/MainForm.cs index d37ff36f..27bcbfab 100644 --- a/PCK-Studio/MainForm.cs +++ b/PCK-Studio/MainForm.cs @@ -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; }