mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-29 05:55:57 +01:00
Use fallback dialect instead of returning null
This commit is contained in:
parent
f149b823a7
commit
32f15d6555
@ -11,6 +11,8 @@ public enum DialectType {
|
||||
MARIADB (MySQLStorage::new, "mariadb"),
|
||||
POSTGRESQL (PostgreSQLStorage::new,"postgresql");
|
||||
|
||||
private static final DialectType FALLBACK = MYSQL;
|
||||
|
||||
private final SQLStorageFactory storageFactory;
|
||||
private final String dialectName;
|
||||
|
||||
@ -28,7 +30,9 @@ public static SQLStorage getStorage(String dialectName, SQLStorageSettings setti
|
||||
return dialect.storageFactory.provide(settings);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
// unknown dialect, use fallback
|
||||
return FALLBACK.storageFactory.provide(settings);
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
|
Loading…
Reference in New Issue
Block a user