From b250603a147abf67fd40ea0d5f2375ad988d0caf Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Fri, 16 Sep 2011 17:33:36 -0500 Subject: [PATCH] guard a use of get-root-data in the token tree implementation closes PR 12072 original commit: 8e5bb730b369b169821695e1b3216d68a8d71d64 --- collects/framework/private/color.rkt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/collects/framework/private/color.rkt b/collects/framework/private/color.rkt index 91e8ac8b..22639fcb 100644 --- a/collects/framework/private/color.rkt +++ b/collects/framework/private/color.rkt @@ -879,8 +879,9 @@ added get-regions (send tokens search! (- (if (eq? direction 'backward) (sub1 position) position) start-pos)) (cond - ((or (eq? 'white-space (data-type (send tokens get-root-data))) - (and comments? (eq? 'comment (data-type (send tokens get-root-data))))) + ((and (send tokens get-root-data) + (or (eq? 'white-space (data-type (send tokens get-root-data))) + (and comments? (eq? 'comment (data-type (send tokens get-root-data)))))) (skip-whitespace (+ start-pos (if (eq? direction 'forward) (send tokens get-root-end-position)