aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes
diff options
context:
space:
mode:
authorab <abdullah_ahmed@brown.edu>2019-04-06 18:43:15 -0400
committerab <abdullah_ahmed@brown.edu>2019-04-06 18:43:15 -0400
commit49310acbdfd7ca239c939208b3766c54e980f6f1 (patch)
tree817528ebd1c8ce303dd1e01950ba23b7ccf80558 /src/client/views/nodes
parentdd561b6b81a2832972d15e6226327a49ec1cdf06 (diff)
drop fraught but technically undoable
Diffstat (limited to 'src/client/views/nodes')
-rw-r--r--src/client/views/nodes/PDFBox.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/nodes/PDFBox.tsx b/src/client/views/nodes/PDFBox.tsx
index 28a1f9757..ba022b007 100644
--- a/src/client/views/nodes/PDFBox.tsx
+++ b/src/client/views/nodes/PDFBox.tsx
@@ -151,7 +151,7 @@ export class PDFBox extends React.Component<FieldViewProps> {
*/
makeEditableAndHighlight = (colour: string) => {
var range, sel = window.getSelection();
- if (sel.rangeCount && sel.getRangeAt) {
+ if (sel && sel.rangeCount && sel.getRangeAt) {
range = sel.getRangeAt(0);
}
document.designMode = "on";
@@ -159,7 +159,7 @@ export class PDFBox extends React.Component<FieldViewProps> {
document.execCommand("HiliteColor", false, colour);
}
- if (range) {
+ if (sel && range) {
sel.removeAllRanges();
sel.addRange(range);