From 3721aaac8cc102b9650add1621861c7819f6ec0a Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Fri, 25 Mar 2022 10:16:38 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B1=D0=B0=D0=B3=D0=B0=20=D0=B2=20?= =?UTF-8?q?AnswerSaveAction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Когда пользователь не добавлял лямбду для скрытого сохранения, приложение падало с nullpointer. Такого быть не должно, опция сохранения данных в скрытом режиме это дополнительная опция, а не обязательная. --- bot-context/pom.xml | 2 +- bot-core/pom.xml | 2 +- .../godfather/core/service/action/AnswerSaveAction.java | 8 +++++--- pom.xml | 6 +++--- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/bot-context/pom.xml b/bot-context/pom.xml index 526502d..92c66c8 100644 --- a/bot-context/pom.xml +++ b/bot-context/pom.xml @@ -6,7 +6,7 @@ dev.struchkov.godfather godfather-bot - 0.0.2 + 0.0.3-SNAPSHOT bot-context diff --git a/bot-core/pom.xml b/bot-core/pom.xml index 0057aa4..8837825 100644 --- a/bot-core/pom.xml +++ b/bot-core/pom.xml @@ -6,7 +6,7 @@ dev.struchkov.godfather godfather-bot - 0.0.2 + 0.0.3-SNAPSHOT bot-core diff --git a/bot-core/src/main/java/dev/struchkov/godfather/core/service/action/AnswerSaveAction.java b/bot-core/src/main/java/dev/struchkov/godfather/core/service/action/AnswerSaveAction.java index ba3c2b3..4f8aaa1 100644 --- a/bot-core/src/main/java/dev/struchkov/godfather/core/service/action/AnswerSaveAction.java +++ b/bot-core/src/main/java/dev/struchkov/godfather/core/service/action/AnswerSaveAction.java @@ -28,9 +28,11 @@ public class AnswerSaveAction implements ActionUnit, Message> { } PreservableData preservableData = answerSave.getPreservableData(); - D data = preservableData.getData(mail); - if (data != null) { - preservable.save(personId, answerSave.getKey(), data); + if (preservableData != null) { + D data = preservableData.getData(mail); + if (data != null) { + preservable.save(personId, answerSave.getKey(), data); + } } preservable.push(personId, answerSave.getPusher()); diff --git a/pom.xml b/pom.xml index 811543a..2ec7c65 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ dev.struchkov.godfather godfather-bot - 0.0.2 + 0.0.3-SNAPSHOT pom @@ -31,8 +31,8 @@ UTF-8 UTF-8 - 0.0.2 - 0.0.2 + 0.0.3-SNAPSHOT + 0.0.3-SNAPSHOT 1.9.4-RELEASE 2.8.9