summaryrefslogtreecommitdiffhomepage
path: root/src/Plugins/Monitors/Common.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Plugins/Monitors/Common.hs')
-rw-r--r--src/Plugins/Monitors/Common.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Plugins/Monitors/Common.hs b/src/Plugins/Monitors/Common.hs
index a8b6542..9ebe828 100644
--- a/src/Plugins/Monitors/Common.hs
+++ b/src/Plugins/Monitors/Common.hs
@@ -337,10 +337,10 @@ combine :: Map.Map String String -> [(String, String, String)] -> Monitor String
combine _ [] = return []
combine m ((s,ts,ss):xs) =
do next <- combine m xs
- let str = Map.findWithDefault err ts m
- err = "<" ++ ts ++ " not found!>"
- nstr <- parseTemplate' str m
- return $ s ++ (if null nstr then str else nstr) ++ ss ++ next
+ str <- case Map.lookup ts m of
+ Nothing -> return $ "<" ++ ts ++ ">"
+ Just r -> let f "" = r; f n = n; in fmap f $ parseTemplate' r m
+ return $ s ++ str ++ ss ++ next
-- $strings