From c3235cc554ea7d60daf17ae2af8d07e34cc7dac7 Mon Sep 17 00:00:00 2001 From: Magesh K <47920326+mahee96@users.noreply.github.com> Date: Sun, 10 Nov 2024 16:22:50 +0530 Subject: [PATCH] -[cleanup]: added guard check to remove file only if it exists --- AltStore/Operations/InstallAppOperation.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/AltStore/Operations/InstallAppOperation.swift b/AltStore/Operations/InstallAppOperation.swift index 3933351e..59e452c8 100644 --- a/AltStore/Operations/InstallAppOperation.swift +++ b/AltStore/Operations/InstallAppOperation.swift @@ -240,8 +240,10 @@ final class InstallAppOperation: ResultOperation do { - try FileManager.default.removeItem(at: fileURL) - print("Removed refreshed IPA") + if(FileManager.default.fileExists(atPath: fileURL.path)){ + try FileManager.default.removeItem(at: fileURL) + print("Removed refreshed IPA") + } } catch {