gpedro / slack-webhook

Slack WebHook Integration for Java
MIT License
182 stars 54 forks source link

SlackAttachment.setTimestamp(Date date) throws NullPointerException #47

Open bubu333gh opened 5 years ago

bubu333gh commented 5 years ago

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)")