From a8d9354bf8f106ce8252262b1576b30def20be97 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Sun, 11 Sep 2022 14:39:45 +0300 Subject: [PATCH] catch FNFE GitHub issue #171 --- .../com/muwire/core/files/PersisterFolderService.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/groovy/com/muwire/core/files/PersisterFolderService.groovy b/core/src/main/groovy/com/muwire/core/files/PersisterFolderService.groovy index 2abe73e5..ffba0e97 100644 --- a/core/src/main/groovy/com/muwire/core/files/PersisterFolderService.groovy +++ b/core/src/main/groovy/com/muwire/core/files/PersisterFolderService.groovy @@ -413,7 +413,11 @@ class PersisterFolderService extends BasePersisterService { File file = path.toFile() if (!file.exists() || !file.isFile()) return null - InfoHash.fromHashList(file.bytes) + try { + return InfoHash.fromHashList(file.bytes) + } catch (FileNotFoundException strange) { + return null + } } private static final class HMACKey implements SecretKey {