From 8f6acf6aae3b389a85cef3867d27c41393c12f3c Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 8 Jan 2011 08:52:42 -0700 Subject: [PATCH] radio-box% initial selection and #f Closes PR 11107 --- collects/mred/private/mritem.rkt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/collects/mred/private/mritem.rkt b/collects/mred/private/mritem.rkt index a948d4615e..3dc522cd34 100644 --- a/collects/mred/private/mritem.rkt +++ b/collects/mred/private/mritem.rkt @@ -333,11 +333,12 @@ (lambda () (let ([cwho '(constructor radio-box)]) (check-container-ready cwho parent) - (unless (< selection (length choices)) - (raise-mismatch-error (who->name cwho) - (format "initial selection is too large, given only ~a choices: " - (length choices)) - selection)))) + (when selection + (unless (< selection (length choices)) + (raise-mismatch-error (who->name cwho) + (format "initial selection is too large, given only ~a choices: " + (length choices)) + selection))))) label parent callback #f))) (when (or (not selection) (positive? selection)) (set-selection selection)))))