check if isJsonNull before getAsString #2326
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Stack trace:
çtime=2023-11-30T11:22:47.981Z | lvl=ERROR | corr=ca63547c-8f72-11ee-ac81-0a580a800215; cbnotif=1 | trans=b69c016a-1f12-4c45-be86-0478d2316e08 | srv=N/A | subsrv=N/A | comp=cygnus-ngsi | op=processNewBatches | msg=com.telefonica.iot.cygnus.sinks.NGSISink[614] : JsonNull Sink: postgis_urbo-sink-postgis Destination: XXX/YYYY Stack trace:
[com.google.gson.JsonElement.getAsString(JsonElement.java:179), com.telefonica.iot.cygnus.containers.NotifyContextRequest$ContextMetadata.getValue(NotifyContextRequest.java:487), com.telefonica.iot.cygnus.containers.NotifyContextRequest$ContextAttribute.getContextMetadata(NotifyContextRequest.java:387), com.telefonica.iot.cygnus.aggregation.NGSIGenericColumnAggregator.aggregate(NGSIGenericColumnAggregator.java:165), com.telefonica.iot.cygnus.sinks.NGSIPostgisSink.persistBatch(NGSIPostgisSink.java:390), com.telefonica.iot.cygnus.sinks.NGSISink.processNewBatches(NGSISink.java:592), com.telefonica.iot.cygnus.sinks.NGSISink.process(NGSISink.java:369), org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:39), org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:145), java.base/java.lang.Thread.run(Thread.java:829)]