From 42bd983c66be4ddf8bd21b4366f3501523ce1e9e Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sat, 29 Mar 2008 21:57:35 +0000 Subject: [PATCH] fixed bug noticed by Sam svn: r9114 original commit: 97dbca2831151c19871419bba4fede37d4d57c71 --- collects/framework/preferences.ss | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/collects/framework/preferences.ss b/collects/framework/preferences.ss index 7b42bc3d..dd1dd42e 100644 --- a/collects/framework/preferences.ss +++ b/collects/framework/preferences.ss @@ -174,16 +174,14 @@ the state transitions / contracts are: ;; unmarshall-pref : symbol marshalled -> any ;; unmarshalls a preference read from the disk (define (unmarshall-pref p data) - (let/ec k - (let* ([unmarshall-fn (un/marshall-unmarshall - (hash-table-get marshall-unmarshall - p - (λ () (k data))))] - [default (hash-table-get defaults p)] - [result (unmarshall-fn data)]) - (if ((default-checker default) result) - result - (default-value default))))) + (let* ([un/marshall (hash-table-get marshall-unmarshall p #f)] + [result (if un/marshall + ((un/marshall-unmarshall un/marshall) data) + data)] + [default (hash-table-get defaults p)]) + (if ((default-checker default) result) + result + (default-value default)))) ;; add-callback : sym (-> void) -> void (define preferences:add-callback