Skip to content

Commit

Permalink
fix: add try/catch to winter-sh
Browse files Browse the repository at this point in the history
  • Loading branch information
to-kn committed Aug 19, 2024
1 parent 7215013 commit 2774435
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ public AdditionalInfo getAdditionalInfo() throws IOException {
info.setTitle(TITLE);
Document doc = Jsoup.parse(xml, "", Parser.xmlParser());
doc.outputSettings(new Document.OutputSettings().prettyPrint(false));
String text = doc.select("item description").first().html().replace("\r\n", "<br>").trim();
String text = "";
try {
text = doc.select("item description").first().html().replace("\r\n", "<br>").trim();
} catch (Exception e) {
// ignore exception
}
if (text.startsWith("Zurzeit gibt es keine Hinweise auf witterungsbedingten Unterrichtsausfall.")
|| text.startsWith("Aktuell gibt es keine Hinweise auf witterungsbedingten Unterrichtsausfall.")) {
info.setHasInformation(false);
Expand Down

0 comments on commit 2774435

Please sign in to comment.