slack-webhook icon indicating copy to clipboard operation
slack-webhook copied to clipboard

SlackAttachment.setTimestamp(Date date) throws NullPointerException

Open bubu333gh opened this issue 5 years ago • 0 comments

Null-check is needed for the setter with Date param because mappers like Mapstruct are mapping null value to it. I had to make a workaround in my mapper like this:

@Mapping(target = "timestamp", expression = "java(slackAttachment.getTimestamp() == null ? null : slackAttachment.getTimestamp().getTime() / 1000L)")

bubu333gh avatar Jun 13 '19 08:06 bubu333gh