From 909a5a2e6de6e25ea953e7c4272864a19b83e324 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Sun, 21 Feb 2021 15:47:03 +0100 Subject: [PATCH] Fix nullptr --- .../tdlight/tdlibsession/td/middle/TdClusterManager.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/it/tdlight/tdlibsession/td/middle/TdClusterManager.java b/src/main/java/it/tdlight/tdlibsession/td/middle/TdClusterManager.java index f6fa9f7..167c0c4 100644 --- a/src/main/java/it/tdlight/tdlibsession/td/middle/TdClusterManager.java +++ b/src/main/java/it/tdlight/tdlibsession/td/middle/TdClusterManager.java @@ -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)); + } } } }