Commit 19061b23 authored by Robert Knight's avatar Robert Knight

Add missing check for error in `onDocumentReady` callback

Note that the existing tests cover this after removing the null-check
for the `document_` argument when `err` is null.
parent 27a8f6be
......@@ -198,7 +198,13 @@ export class VitalSourceInjector {
}
contentFrames.add(frame);
onDocumentReady(frame, (err, document_) => {
const body = document_?.body;
if (err) {
return;
}
// If `err` is null, then `document_` will be set.
const body = document_!.body;
const isBookContent =
body &&
// Check that this is not the temporary page containing encrypted and
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment