Skip to content

Commit

Permalink
Adds null checks when accessing OperationalLimits in config since the…
Browse files Browse the repository at this point in the history
…y might not have been set yet.
  • Loading branch information
acrites committed Aug 1, 2024
1 parent 21009e6 commit 44f4836
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,13 @@ private StreamingEnginePipelineConfig createPipelineConfig(StreamingConfigTask c
}

if (config.getOperationalLimits() != null) {
if (config.getOperationalLimits().getMaxKeyBytes() > 0
if (config.getOperationalLimits().getMaxKeyBytes() != null
&& config.getOperationalLimits().getMaxKeyBytes() > 0
&& config.getOperationalLimits().getMaxKeyBytes() <= Integer.MAX_VALUE) {
pipelineConfig.setMaxOutputKeyBytes(config.getOperationalLimits().getMaxKeyBytes());
}
if (config.getOperationalLimits().getMaxProductionOutputBytes() > 0
if (config.getOperationalLimits().getMaxProductionOutputBytes() != null
&& config.getOperationalLimits().getMaxProductionOutputBytes() > 0
&& config.getOperationalLimits().getMaxProductionOutputBytes() <= Integer.MAX_VALUE) {
pipelineConfig.setMaxOutputValueBytes(
config.getOperationalLimits().getMaxProductionOutputBytes());
Expand Down

0 comments on commit 44f4836

Please sign in to comment.