From 460505b5ed48f7da854d939f6ecb14460b28c71e Mon Sep 17 00:00:00 2001 From: David Roundy Date: Fri, 10 Aug 2007 19:04:45 +0200 Subject: don't crash when given a non-existent font in XPrompt. darcs-hash:20070810170445-72aca-1784272b5a0036ed007916221840c73436650ef2.gz --- XPrompt.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'XPrompt.hs') diff --git a/XPrompt.hs b/XPrompt.hs index 1b15f13..c00f8d9 100644 --- a/XPrompt.hs +++ b/XPrompt.hs @@ -130,7 +130,8 @@ mkXPrompt t conf compl action = do liftIO $ selectInput d w $ exposureMask .|. keyPressMask gc <- liftIO $ createGC d w liftIO $ setGraphicsExposures d gc False - fontS <- liftIO $ loadQueryFont d (font conf) + fontS <- liftIO (loadQueryFont d (font conf) `catch` + \_ -> loadQueryFont d "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*") (hist,h) <- liftIO $ readHistory let st = initState d rw w s compl gc fontS (XPT t) hist conf st' <- liftIO $ execStateT runXP st -- cgit v1.2.3