Try and fix NPE in MigrationRunner, when DataSource is null

This commit is contained in:
Jonas Pöhler
2021-11-19 17:56:58 +01:00
parent 3efb552bd9
commit 78681fdee8
@@ -383,7 +383,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
* Start any services after registering with the ClusterManager.
*/
public void start() {
if (config.isRunMigration() && TenantMode.DB != config.getTenantMode()) {
if (config.getDataSource() != null && config.isRunMigration() && TenantMode.DB != config.getTenantMode()) {
final AutoMigrationRunner migrationRunner = ServiceUtil.service(AutoMigrationRunner.class);
if (migrationRunner == null) {
throw new IllegalStateException("No AutoMigrationRunner found. Probably ebean-migration is not in the classpath?");