Skip to content

Commit 5a9aad7

Browse files
committed
change: return empty build date and list instead of null for no last build date
1 parent 94cf7a1 commit 5a9aad7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/pw/mihou/amelia/io/rome/RssReader.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import org.w3c.dom.NodeList
66
import pw.mihou.amelia.Amelia
77
import pw.mihou.amelia.io.xml.SimpleXmlClient
88
import pw.mihou.amelia.logger
9+
import java.time.Instant
910
import java.util.Date
1011
import java.util.concurrent.TimeUnit
1112

@@ -31,7 +32,7 @@ object RssReader {
3132
val lastBuildDate = document.getElementsByTagName("lastBuildDate").item(0)
3233
if (lastBuildDate.textContent == "") {
3334
logger.warn("$url has no last build date.")
34-
return null
35+
return Date.from(Instant.now()) to emptyList()
3536
}
3637
Amelia.formatter.parse(lastBuildDate.textContent) to nodeListToFeedItems(document.getElementsByTagName("item"))
3738
} catch (exception: Exception) {

0 commit comments

Comments
 (0)