From 1c99d0a4681b983cd51233e050311ca99691740e Mon Sep 17 00:00:00 2001 From: Julian Date: Tue, 22 Jun 2021 16:13:37 +0200 Subject: [PATCH] Only update forum posts if post id was found --- .../de/jeyp91/tippligaforum/MatchesListForumUpdater.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/jeyp91/tippligaforum/MatchesListForumUpdater.java b/src/main/java/de/jeyp91/tippligaforum/MatchesListForumUpdater.java index de32a45..bd03062 100644 --- a/src/main/java/de/jeyp91/tippligaforum/MatchesListForumUpdater.java +++ b/src/main/java/de/jeyp91/tippligaforum/MatchesListForumUpdater.java @@ -27,9 +27,11 @@ public class MatchesListForumUpdater { MatchesListCreator creator = new MatchesListCreator(league); String content = creator.getMatchesBeautiful(); String contentWithCodeBBCode = "[code]" + content + "[/code]"; - int postId = getPostId(creator.getCountry(), creator.getLeagueName()); - TippligaSQLConnector con = TippligaSQLConnector.getInstance(); - con.updatePost(postId, contentWithCodeBBCode); + Integer postId = getPostId(creator.getCountry(), creator.getLeagueName()); + if(postId != null) { + TippligaSQLConnector con = TippligaSQLConnector.getInstance(); + con.updatePost(postId, contentWithCodeBBCode); + } } private Integer getPostId(String country, String league) {