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

Signed-off-by: Graham <gpe@openrs2.org>
pull/132/head
Graham 3 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
val masterIndex = createMasterIndex(store)
if (masterIndex.index.entries.isEmpty()) {
throw IOException("Master index empty, cache probably corrupt")
}
val masterIndexId = try {
addMasterIndex(connection, masterIndex)
} finally {

Loading…
Cancel
Save