Throw an exception when the gates got stored with a newer version.

This commit is contained in:
Tobias Ottenweller 2013-05-26 13:03:22 +02:00
parent 8e860e90c6
commit 95446f1371

View File

@ -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);