summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-11 16:47:25 +0000
committerFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-11 16:47:25 +0000
commit4463070f1c8f0bb6337e97b39dfbb0a36a9f4676 (patch)
tree2aad6321b0216e1cdcf13b24195d563127fd5a1d /desktop
parent76444db118faeae3725d8e6efacfc5ec6bb958e4 (diff)
downloadnetsurf-4463070f1c8f0bb6337e97b39dfbb0a36a9f4676.tar.gz
netsurf-4463070f1c8f0bb6337e97b39dfbb0a36a9f4676.tar.bz2
Fix selection in plain text files, check if s->defined first, and check s->root just in case.
svn path=/trunk/netsurf/; revision=5537
Diffstat (limited to 'desktop')
-rw-r--r--desktop/selection.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/desktop/selection.c b/desktop/selection.c
index 2113f7d0c..ac314bd7f 100644
--- a/desktop/selection.c
+++ b/desktop/selection.c
@@ -729,7 +729,7 @@ void selection_set_start(struct selection *s, unsigned offset)
s->start_idx = offset;
s->defined = (s->start_idx < s->end_idx);
- if (s->root->gadget && s->defined) {
+ if (s->defined && s->root && s->root->gadget) {
/* update the caret text_box and offset so that it stays at the
* beginning of the selection */
s->root->gadget->caret_text_box = selection_get_start(s,