From 79b0103a06c68ec65a7c8a9ab0fb08237c1c945a Mon Sep 17 00:00:00 2001 From: Graham Date: Sun, 7 Jun 2020 10:52:39 +0100 Subject: [PATCH] Return empty NameMap if the share/deob/map directory does not exist Signed-off-by: Graham --- .../src/main/java/dev/openrs2/deob/map/NameMapProvider.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deob-map/src/main/java/dev/openrs2/deob/map/NameMapProvider.kt b/deob-map/src/main/java/dev/openrs2/deob/map/NameMapProvider.kt index 598e3dec..db2d7be5 100644 --- a/deob-map/src/main/java/dev/openrs2/deob/map/NameMapProvider.kt +++ b/deob-map/src/main/java/dev/openrs2/deob/map/NameMapProvider.kt @@ -11,6 +11,10 @@ class NameMapProvider @Inject constructor(private val mapper: ObjectMapper) : Pr override fun get(): NameMap { val combinedMap = NameMap() + if (!Files.exists(PATH)) { + return combinedMap + } + for (file in Files.list(PATH).filter(::isYamlFile)) { val map = Files.newBufferedReader(file).use { reader -> mapper.readValue(reader, NameMap::class.java)