Исправление бага в 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> <parent>
<groupId>dev.struchkov.godfather</groupId> <groupId>dev.struchkov.godfather</groupId>
<artifactId>godfather-bot</artifactId> <artifactId>godfather-bot</artifactId>
<version>0.0.2</version> <version>0.0.3-SNAPSHOT</version>
</parent> </parent>
<artifactId>bot-context</artifactId> <artifactId>bot-context</artifactId>

View File

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

View File

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

View File

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