From dadfbdb7379ebe9623643902a6a0aa78ca528228 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 17 Jan 2018 13:53:19 +0300 Subject: api: fix username logging --- juick-api/src/main/java/com/juick/api/TelegramBotManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'juick-api/src/main/java/com') diff --git a/juick-api/src/main/java/com/juick/api/TelegramBotManager.java b/juick-api/src/main/java/com/juick/api/TelegramBotManager.java index 757dd347..321ad7b1 100644 --- a/juick-api/src/main/java/com/juick/api/TelegramBotManager.java +++ b/juick-api/src/main/java/com/juick/api/TelegramBotManager.java @@ -17,6 +17,7 @@ package com.juick.api; +import com.juick.User; import com.juick.server.component.MessageEvent; import com.juick.service.MessagesService; import com.juick.service.SubscriptionService; @@ -134,7 +135,8 @@ public class TelegramBotManager implements ApplicationListener { int userId = telegramService.getUser(chatId); if (userId > 0) { telegramService.deleteTelegramUser(chatId.intValue()); - logger.info("deleted telegram id of @{}", userService.getUserByUID(userId)); + logger.info("deleted telegram id of @{}", userService.getUserByUID(userId) + .orElse(new User()).getName()); } } else { logger.warn("error response, isOk: {}, errorCode: {}, description: {}", -- cgit v1.2.3