Making sure quote/start/end don't throw errors in Annotorious

This commit is contained in:
Rainer Simon 2022-02-15 14:14:42 +01:00 committed by GitHub
parent 003fb44447
commit 4023bc6b8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -103,17 +103,17 @@ export default class WebAnnotation {
/** Shorthand for the 'exact' field of the TextQuoteSelector **/ /** Shorthand for the 'exact' field of the TextQuoteSelector **/
get quote() { get quote() {
return this.selector('TextQuoteSelector').exact; return this.selector('TextQuoteSelector')?.exact;
} }
/** Shorthand for the 'start' field of the TextPositionSelector **/ /** Shorthand for the 'start' field of the TextPositionSelector **/
get start() { get start() {
return this.selector('TextPositionSelector').start; return this.selector('TextPositionSelector')?.start;
} }
/** Shorthand for the 'end' field of the TextPositionSelector **/ /** Shorthand for the 'end' field of the TextPositionSelector **/
get end() { get end() {
return this.selector('TextPositionSelector').end; return this.selector('TextPositionSelector')?.end;
} }
} }