Skip to content

Commit d6f0ee9

Browse files
authored
Make ContentService.content not nullable (#306)
1 parent 22e7313 commit d6f0ee9

File tree

1 file changed

+3
-3
lines changed
  • readium/shared/src/main/java/org/readium/r2/shared/publication/services/content

1 file changed

+3
-3
lines changed

readium/shared/src/main/java/org/readium/r2/shared/publication/services/content/ContentService.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ interface ContentService : Publication.Service {
2525
* The implementation must be fast and non-blocking. Do the actual extraction inside the
2626
* [Content] implementation.
2727
*/
28-
fun content(start: Locator?): Content?
28+
fun content(start: Locator?): Content
2929
}
3030

3131
/**
@@ -64,8 +64,8 @@ class DefaultContentService(
6464
}
6565
}
6666

67-
override fun content(start: Locator?): Content? {
68-
val publication = publication() ?: return null
67+
override fun content(start: Locator?): Content {
68+
val publication = publication() ?: throw IllegalStateException("No Publication object")
6969
return ContentImpl(publication, start)
7070
}
7171

0 commit comments

Comments
 (0)