From d5243d7af2fe77915c473d404ec557e8f7317291 Mon Sep 17 00:00:00 2001 From: "Eric J. Bowersox" Date: Mon, 2 Aug 2004 22:57:40 +0000 Subject: [PATCH] whoops - needed to catch some exceptions --- .../htmlcheck/filters/EmoticonTagHandler.java | 13 ++++++++++++- .../venice/ui/config/EmoticonManager.java | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/com/silverwrist/venice/htmlcheck/filters/EmoticonTagHandler.java b/src/com/silverwrist/venice/htmlcheck/filters/EmoticonTagHandler.java index 633edbb..cf419be 100644 --- a/src/com/silverwrist/venice/htmlcheck/filters/EmoticonTagHandler.java +++ b/src/com/silverwrist/venice/htmlcheck/filters/EmoticonTagHandler.java @@ -91,7 +91,18 @@ public class EmoticonTagHandler implements Rewriter public MarkupData rewrite(String data, RewriterServices svc) { logger.debug("EmoticonTagHandler looking at: " + data); - RE r = new RE("ei:\\s*(\\w+)(?:\\s*/)?\\s*"); + RE r = null; + try + { // compile regular expression + r = new RE("ei:\\s*(\\w+)(?:\\s*/)?\\s*"); + + } // end try + catch (RESyntaxException e) + { // something wicked this way comes + logger.fatal("WTF?!?!?!?",e); + + } // end catch + if (!(r.match(data))) return null; String icon_name = r.getParen(1); diff --git a/src/com/silverwrist/venice/ui/config/EmoticonManager.java b/src/com/silverwrist/venice/ui/config/EmoticonManager.java index 9a830ee..dd3b14a 100644 --- a/src/com/silverwrist/venice/ui/config/EmoticonManager.java +++ b/src/com/silverwrist/venice/ui/config/EmoticonManager.java @@ -149,7 +149,18 @@ public class EmoticonManager public String rewriteText(RequestOutput out, String txt) { - RE r = new RE(""); + RE r = null; + try + { // create the regexp + r = new RE(""); + + } // end try + catch (RESyntaxException e) + { // something wicked this way comes + logger.fatal("WTF?!?!?!?",e); + + } // end catch + if (!(r.match(txt))) { // null it out logger.debug("EmoticonManager.rewriteText matched nothing at all");