From 7a35fb0ee839bf20afdebd7cbc45c19f40775b9a Mon Sep 17 00:00:00 2001 From: azhohov Date: Sat, 22 Apr 2017 00:45:26 +0300 Subject: [PATCH] fix NPE --- .../java/org/telegram/telegrambots/api/objects/Message.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/Message.java b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/Message.java index 1c90f1c4..96821997 100644 --- a/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/Message.java +++ b/telegrambots-meta/src/main/java/org/telegram/telegrambots/api/objects/Message.java @@ -183,7 +183,9 @@ public class Message implements BotApiObject { } public List getEntities() { - entities.forEach(x -> x.computeText(text)); + if (entities != null) { + entities.forEach(x -> x.computeText(text)); + } return entities; }