NPE fix in DefaultTbContext
This commit is contained in:
parent
c0f64c836e
commit
f0d887b91a
@ -169,7 +169,9 @@ class DefaultTbContext implements TbContext {
|
|||||||
private void enqueue(TopicPartitionInfo tpi, TbMsg tbMsg, Consumer<Throwable> onFailure, Runnable onSuccess) {
|
private void enqueue(TopicPartitionInfo tpi, TbMsg tbMsg, Consumer<Throwable> onFailure, Runnable onSuccess) {
|
||||||
if (!tbMsg.isValid()) {
|
if (!tbMsg.isValid()) {
|
||||||
log.trace("[{}] Skip invalid message: {}", getTenantId(), tbMsg);
|
log.trace("[{}] Skip invalid message: {}", getTenantId(), tbMsg);
|
||||||
onFailure.accept(new IllegalArgumentException("Source message is no longer valid!"));
|
if (onFailure != null) {
|
||||||
|
onFailure.accept(new IllegalArgumentException("Source message is no longer valid!"));
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TransportProtos.ToRuleEngineMsg msg = TransportProtos.ToRuleEngineMsg.newBuilder()
|
TransportProtos.ToRuleEngineMsg msg = TransportProtos.ToRuleEngineMsg.newBuilder()
|
||||||
@ -242,7 +244,9 @@ class DefaultTbContext implements TbContext {
|
|||||||
private void enqueueForTellNext(TopicPartitionInfo tpi, String queueName, TbMsg source, Set<String> relationTypes, String failureMessage, Runnable onSuccess, Consumer<Throwable> onFailure) {
|
private void enqueueForTellNext(TopicPartitionInfo tpi, String queueName, TbMsg source, Set<String> relationTypes, String failureMessage, Runnable onSuccess, Consumer<Throwable> onFailure) {
|
||||||
if (!source.isValid()) {
|
if (!source.isValid()) {
|
||||||
log.trace("[{}] Skip invalid message: {}", getTenantId(), source);
|
log.trace("[{}] Skip invalid message: {}", getTenantId(), source);
|
||||||
onFailure.accept(new IllegalArgumentException("Source message is no longer valid!"));
|
if (onFailure != null) {
|
||||||
|
onFailure.accept(new IllegalArgumentException("Source message is no longer valid!"));
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
RuleChainId ruleChainId = nodeCtx.getSelf().getRuleChainId();
|
RuleChainId ruleChainId = nodeCtx.getSelf().getRuleChainId();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user