Making sure quote/start/end don't throw errors in Annotorious
This commit is contained in:
parent
003fb44447
commit
4023bc6b8f
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue