diff --git a/TelegramBots.wiki/FAQ.md b/TelegramBots.wiki/FAQ.md index 928d9536..6de36ec0 100644 --- a/TelegramBots.wiki/FAQ.md +++ b/TelegramBots.wiki/FAQ.md @@ -22,7 +22,7 @@ public PhotoSize getPhoto(Update update) { // We fetch the bigger photo return photos.stream() - .max(Comparator.comparing(PhotoSize::getFileSize)).get(); + .max(Comparator.comparing(PhotoSize::getFileSize)).orElse(null); } // Return null if not found