File tree Expand file tree Collapse file tree 1 file changed +16
-15
lines changed
readium/streamer/src/main/java/org/readium/r2/streamer Expand file tree Collapse file tree 1 file changed +16
-15
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import org.readium.r2.shared.util.mediatype.FormatRegistry
2727import org.readium.r2.shared.util.mediatype.MediaType
2828import org.readium.r2.shared.util.mediatype.MediaTypeRetriever
2929import org.readium.r2.streamer.parser.PublicationParser
30+ import timber.log.Timber
3031
3132internal class ParserAssetFactory (
3233 private val httpClient : HttpClient ,
@@ -76,22 +77,22 @@ internal class ParserAssetFactory(
7677 }
7778 .getOrElse { return Try .failure(it) }
7879
79- val baseUrl =
80- manifest.linkWithRel(" self" )?.href?.resolve()
81- ? : return Try .failure(
82- Publication .OpenError .InvalidAsset (" No self link in the manifest." )
80+ val baseUrl = manifest.linkWithRel(" self" )?.href?.resolve()
81+ if (baseUrl == null ) {
82+ Timber .w(" No self link found in the manifest at ${asset.resource.source} " )
83+ } else {
84+ if (baseUrl !is AbsoluteUrl ) {
85+ return Try .failure(
86+ Publication .OpenError .InvalidAsset (" Self link is not absolute." )
8387 )
84-
85- if (baseUrl !is AbsoluteUrl ) {
86- return Try .failure(
87- Publication .OpenError .InvalidAsset (" Self link is not absolute." )
88- )
89- }
90-
91- if (! baseUrl.isHttp) {
92- return Try .failure(
93- Publication .OpenError .UnsupportedAsset (" Self link doesn't use the HTTP(S) scheme." )
94- )
88+ }
89+ if (! baseUrl.isHttp) {
90+ return Try .failure(
91+ Publication .OpenError .UnsupportedAsset (
92+ " Self link doesn't use the HTTP(S) scheme."
93+ )
94+ )
95+ }
9596 }
9697
9798 val container =
You can’t perform that action at this time.
0 commit comments