Fix npe in MessageSender (#120)
This commit is contained in:
parent
9df803b90c
commit
3bd2fe516b
@ -14,6 +14,7 @@ import org.apache.http.HttpStatus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
@Slf4j
|
||||
@ -47,7 +48,7 @@ public abstract class MessageSender<M extends Message> implements Callable<Messa
|
||||
queueStatus.setSuccess(true);
|
||||
} catch (Exception e) {
|
||||
if (currentMessage != null)
|
||||
log.warn("Couldn't send message with id {} {} to hook {}. We'll try to resend it", currentMessage.getId(), currentMessage, queueStatus.getQueue().getHook(), e);
|
||||
log.warn("Couldn't send message with id {} {} to hook {}. We'll try to resend it", currentMessage.getId(), currentMessage, Optional.ofNullable(queueStatus).map(QueueStatus::getQueue).map(Queue::getHook), e);
|
||||
queueStatus.setSuccess(false);
|
||||
}
|
||||
return queueStatus;
|
||||
|
Loading…
Reference in New Issue
Block a user