Commit 078e2c5e6bc692419b66aa21077e76a827b285dc
1 parent
ccc08545
Fixed Telegram Nullpointer Exception (due to null-attachment).
Showing
2 changed files
with
28 additions
and
0 deletions
services/Scheduler/build.gradle
0 → 100644
1 | +apply plugin: 'java' | |
2 | +apply plugin: 'war' | |
3 | +apply plugin: 'checkstyle' | |
4 | + | |
5 | +sourceCompatibility = 1.8 | |
6 | + | |
7 | +repositories { | |
8 | + mavenCentral() | |
9 | +} | |
10 | + | |
11 | +dependencies { | |
12 | + compile project(':services:Common'), | |
13 | + "org.jboss.spec:jboss-javaee-7.0:1.1.0.Final", | |
14 | + "org.apache.httpcomponents:httpclient:4.5.3", | |
15 | + "org.apache.httpcomponents:httpmime:4.3.1" | |
16 | + providedCompile "org.slf4j:slf4j-api:1.7.25", | |
17 | + "org.jboss.resteasy:resteasy-client:3.1.3.Final", | |
18 | + "org.jboss.resteasy:resteasy-jaxrs-all:3.1.3.Final" | |
19 | +} | |
20 | + | |
21 | +war { | |
22 | + destinationDir new File(project.rootProject.projectDir, 'docker/wildfly/volumes/deployments/') | |
23 | + archiveName "scheduler.war" | |
24 | +} | |
0 | 25 | \ No newline at end of file | ... | ... |
services/Telegram/src/main/java/de/bht/beuthbot/messenger/telegram/model/TelegramMessage.java
... | ... | @@ -86,6 +86,10 @@ public class TelegramMessage implements ProcessQueueMessageProtocol{ |
86 | 86 | * @param attachments |
87 | 87 | */ |
88 | 88 | public void setAttachments(final Attachment[] attachments){ |
89 | + if (attachments == null) { | |
90 | + this.attachments = new ArrayList<>(); | |
91 | + return; | |
92 | + } | |
89 | 93 | this.attachments = new ArrayList<>(attachments.length); |
90 | 94 | for (Attachment attachment : attachments) { |
91 | 95 | this.attachments.add(attachment); | ... | ... |