From 20d5cf96f77f71d8c18ebc62755620fe90abfb78 Mon Sep 17 00:00:00 2001 From: jpirnay Date: Fri, 27 Mar 2026 17:28:06 +0100 Subject: [PATCH] Proper return code --- lib/Epub/Epub.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Epub/Epub.cpp b/lib/Epub/Epub.cpp index 7c1120f9..119743e2 100644 --- a/lib/Epub/Epub.cpp +++ b/lib/Epub/Epub.cpp @@ -875,12 +875,12 @@ bool Epub::hasReliableToc() const { int Epub::getTocIndexForSpineIndex(const int spineIndex) const { if (!bookMetadataCache || !bookMetadataCache->isLoaded()) { LOG_ERR("EBP", "getTocIndexForSpineIndex called but cache not loaded"); - return 0; + return -1; } if (spineIndex < 0 || spineIndex >= bookMetadataCache->getSpineCount()) { LOG_ERR("EBP", "getTocIndexForSpineIndex: spineIndex %d out of range", spineIndex); - return 0; + return -1; } if (syntheticTocFallbackEnabled && !hasReliableToc()) {