Fix nullptr

This commit is contained in:
Andrea Cavalli 2021-02-21 15:47:03 +01:00
parent 3a47d92522
commit 909a5a2e6d

View File

@ -59,8 +59,11 @@ public class TdClusterManager {
.registerDefaultCodec(TdResultMessage.class, new TdResultMessageCodec())
.registerDefaultCodec(StartSessionMessage.class, new StartSessionMessageCodec())
.registerDefaultCodec(EndSessionMessage.class, new EndSessionMessageCodec());
for (Class<?> value : ConstructorDetector.getTDConstructorsUnsafe().values()) {
vertx.eventBus().getDelegate().registerDefaultCodec(value, new TdMessageCodec(value));
var constructors = ConstructorDetector.getTDConstructorsUnsafe();
if (constructors != null) {
for (Class<?> value : constructors.values()) {
vertx.eventBus().getDelegate().registerDefaultCodec(value, new TdMessageCodec(value));
}
}
}
}