diff --git a/src/Epub/Package.cs b/src/Epub/Package.cs index cdbb994..4ce0d1c 100644 --- a/src/Epub/Package.cs +++ b/src/Epub/Package.cs @@ -52,7 +52,7 @@ internal Package(ZipArchive zip, XDocument document, string baseDir = "OEBPS") var ids = document.XPathSelectElements("opf:package/opf:metadata/dc:identifier", xmlns); var pid = (uid == null ? ids.FirstOrDefault() : - ids.FirstOrDefault(x => x.Attribute("id")?.Value == uid)) + ids.FirstOrDefault(x => x.Attribute("id")?.Value == uid)) ?? throw new InvalidArchiveException(ThisAssembly.Strings.MissingIdentifier); var date = document.XPathSelectElement("opf:package/opf:metadata/opf:meta[@property='dcterms:modified']", xmlns)?.Value; diff --git a/src/Epub/Publication.cs b/src/Epub/Publication.cs index 6c086d8..d7eee38 100644 --- a/src/Epub/Publication.cs +++ b/src/Epub/Publication.cs @@ -65,7 +65,7 @@ Package ReadPackage() using var reader = XmlReader.Create(entry.Open()).IgnoreNamespaces(); var doc = XDocument.Load(reader); - var root = doc.CssSelectElement("rootfile[full-path][media-type=application/oebps-package+xml]") + var root = doc.CssSelectElement("rootfile[full-path][media-type=application/oebps-package+xml]") ?? throw new InvalidArchiveException(ThisAssembly.Strings.MissingPackage); var path = root.Attribute("full-path")?.Value;