Only update forum posts if post id was found
This commit is contained in:
@@ -27,9 +27,11 @@ public class MatchesListForumUpdater {
|
|||||||
MatchesListCreator creator = new MatchesListCreator(league);
|
MatchesListCreator creator = new MatchesListCreator(league);
|
||||||
String content = creator.getMatchesBeautiful();
|
String content = creator.getMatchesBeautiful();
|
||||||
String contentWithCodeBBCode = "<r><CODE><s>[code]</s>" + content + "<e>[/code]</e></CODE></r>";
|
String contentWithCodeBBCode = "<r><CODE><s>[code]</s>" + content + "<e>[/code]</e></CODE></r>";
|
||||||
int postId = getPostId(creator.getCountry(), creator.getLeagueName());
|
Integer postId = getPostId(creator.getCountry(), creator.getLeagueName());
|
||||||
TippligaSQLConnector con = TippligaSQLConnector.getInstance();
|
if(postId != null) {
|
||||||
con.updatePost(postId, contentWithCodeBBCode);
|
TippligaSQLConnector con = TippligaSQLConnector.getInstance();
|
||||||
|
con.updatePost(postId, contentWithCodeBBCode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Integer getPostId(String country, String league) {
|
private Integer getPostId(String country, String league) {
|
||||||
|
|||||||
Reference in New Issue
Block a user