From 1aea83798cfa55998e50e53e6ecd4fc2e2e2e19b Mon Sep 17 00:00:00 2001 From: Aayush Gupta Date: Sat, 8 Nov 2025 10:29:43 +0800 Subject: [PATCH] HistoryDao: latestEntry can be null Signed-off-by: Aayush Gupta --- .../java/org/schabi/newpipe/database/history/dao/HistoryDAO.kt | 2 +- .../org/schabi/newpipe/database/history/dao/SearchHistoryDAO.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/database/history/dao/HistoryDAO.kt b/app/src/main/java/org/schabi/newpipe/database/history/dao/HistoryDAO.kt index d986d0c3b..fda46073b 100644 --- a/app/src/main/java/org/schabi/newpipe/database/history/dao/HistoryDAO.kt +++ b/app/src/main/java/org/schabi/newpipe/database/history/dao/HistoryDAO.kt @@ -9,5 +9,5 @@ package org.schabi.newpipe.database.history.dao import org.schabi.newpipe.database.BasicDAO interface HistoryDAO : BasicDAO { - val latestEntry: T + val latestEntry: T? } diff --git a/app/src/main/java/org/schabi/newpipe/database/history/dao/SearchHistoryDAO.kt b/app/src/main/java/org/schabi/newpipe/database/history/dao/SearchHistoryDAO.kt index a249721fc..e20e10de9 100644 --- a/app/src/main/java/org/schabi/newpipe/database/history/dao/SearchHistoryDAO.kt +++ b/app/src/main/java/org/schabi/newpipe/database/history/dao/SearchHistoryDAO.kt @@ -15,7 +15,7 @@ import org.schabi.newpipe.database.history.model.SearchHistoryEntry interface SearchHistoryDAO : HistoryDAO { @get:Query("SELECT * FROM search_history WHERE id = (SELECT MAX(id) FROM search_history)") - override val latestEntry: SearchHistoryEntry + override val latestEntry: SearchHistoryEntry? @Query("DELETE FROM search_history") override fun deleteAll(): Int