Throw exception before importing a cache if its master index is empty

Signed-off-by: Graham <gpe@openrs2.org>
bzip2
Graham 4 years ago
parent ae88bca924
commit a6fa7bf5b6
  1. 4
      archive/src/main/kotlin/org/openrs2/archive/cache/CacheImporter.kt

@ -101,6 +101,10 @@ public class CacheImporter @Inject constructor(
// import master index // import master index
val masterIndex = createMasterIndex(store) val masterIndex = createMasterIndex(store)
if (masterIndex.index.entries.isEmpty()) {
throw IOException("Master index empty, cache probably corrupt")
}
val masterIndexId = try { val masterIndexId = try {
addMasterIndex(connection, masterIndex) addMasterIndex(connection, masterIndex)
} finally { } finally {

Loading…
Cancel
Save