Only update forum posts if post id was found

This commit is contained in:
2021-06-22 16:13:37 +02:00
parent 952f869f59
commit 1c99d0a468

View File

@@ -27,9 +27,11 @@ public class MatchesListForumUpdater {
MatchesListCreator creator = new MatchesListCreator(league);
String content = creator.getMatchesBeautiful();
String contentWithCodeBBCode = "<r><CODE><s>[code]</s>" + content + "<e>[/code]</e></CODE></r>";
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) {