From 95446f137110cbe66b457d11eb2c790719a8546c Mon Sep 17 00:00:00 2001 From: Tobias Ottenweller Date: Sun, 26 May 2013 13:03:22 +0200 Subject: [PATCH] Throw an exception when the gates got stored with a newer version. --- src/de/craftinc/gates/GatesManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/de/craftinc/gates/GatesManager.java b/src/de/craftinc/gates/GatesManager.java index 5cebd5a..b68b57b 100644 --- a/src/de/craftinc/gates/GatesManager.java +++ b/src/de/craftinc/gates/GatesManager.java @@ -102,6 +102,10 @@ public class GatesManager // migration int fileStorageVersion = gatesConfig.getInt(storageVersionPath); + if (fileStorageVersion > storageVersion) { + throw new RuntimeException("Unsupported storage version detected! Make sure you have the latest version of Craft Inc. Gates installed."); + } + if (fileStorageVersion < storageVersion) { Plugin.log("Outdated storage version detected. Performing data migration..."); MigrationUtil.performMigration(fileStorageVersion, storageVersion, this.gates);