Исправление бага в AnswerSaveAction

Когда пользователь не добавлял лямбду для скрытого сохранения, приложение падало с nullpointer. Такого быть не должно, опция сохранения данных в скрытом режиме это дополнительная опция, а не обязательная.
This commit is contained in:
Struchkov Mark 2022-03-25 10:16:38 +03:00
parent 574862b44c
commit 3721aaac8c
4 changed files with 10 additions and 8 deletions

View File

@ -6,7 +6,7 @@
<parent>
<groupId>dev.struchkov.godfather</groupId>
<artifactId>godfather-bot</artifactId>
<version>0.0.2</version>
<version>0.0.3-SNAPSHOT</version>
</parent>
<artifactId>bot-context</artifactId>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>dev.struchkov.godfather</groupId>
<artifactId>godfather-bot</artifactId>
<version>0.0.2</version>
<version>0.0.3-SNAPSHOT</version>
</parent>
<artifactId>bot-core</artifactId>

View File

@ -28,10 +28,12 @@ public class AnswerSaveAction<D> implements ActionUnit<AnswerSave<D>, Message> {
}
PreservableData<D, ? super Message> preservableData = answerSave.getPreservableData();
if (preservableData != null) {
D data = preservableData.getData(mail);
if (data != null) {
preservable.save(personId, answerSave.getKey(), data);
}
}
preservable.push(personId, answerSave.getPusher());
return answerSave;

View File

@ -6,7 +6,7 @@
<groupId>dev.struchkov.godfather</groupId>
<artifactId>godfather-bot</artifactId>
<version>0.0.2</version>
<version>0.0.3-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
@ -31,8 +31,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<godfather.context.ver>0.0.2</godfather.context.ver>
<godfather.core.ver>0.0.2</godfather.core.ver>
<godfather.context.ver>0.0.3-SNAPSHOT</godfather.context.ver>
<godfather.core.ver>0.0.3-SNAPSHOT</godfather.core.ver>
<autoresponder.ver>1.9.4-RELEASE</autoresponder.ver>
<gson.ver>2.8.9</gson.ver>