Author: ssmiweve
Date: 2009-02-11 19:21:57 +0100 (Wed, 11 Feb 2009)
New Revision: 7198

Modified:
   
branches/2.18/generic.sesam/velocity-directives/src/main/java/no/sesat/search/view/velocity/AbstractDirective.java
   
branches/2.18/generic.sesam/velocity-directives/src/main/java/no/sesat/search/view/velocity/BoldWordDirective.java
Log:
SEARCH-5474 - Search returns 500-error in NettTV tab


Modified: 
branches/2.18/generic.sesam/velocity-directives/src/main/java/no/sesat/search/view/velocity/AbstractDirective.java
===================================================================
--- 
branches/2.18/generic.sesam/velocity-directives/src/main/java/no/sesat/search/view/velocity/AbstractDirective.java
  2009-02-05 15:37:06 UTC (rev 7197)
+++ 
branches/2.18/generic.sesam/velocity-directives/src/main/java/no/sesat/search/view/velocity/AbstractDirective.java
  2009-02-11 18:21:57 UTC (rev 7198)
@@ -1,4 +1,4 @@
-/* Copyright (2007-2008) Schibsted Søk AS
+/* Copyright (2007-2009) Schibsted Søk AS
  *   This file is part of SESAT.
  *
  *   SESAT is free software: you can redistribute it and/or modify
@@ -65,7 +65,10 @@
     }
 
     protected String getArgument(final InternalContextAdapter context, final 
Node node, final int i){
-        return node.jjtGetChild(i).value(context).toString();
+
+        return null != node.jjtGetChild(i).value(context)
+                ? node.jjtGetChild(i).value(context).toString()
+                : null;
     }
 
     protected Object getObjectArgument(final InternalContextAdapter context, 
final Node node, final int i){

Modified: 
branches/2.18/generic.sesam/velocity-directives/src/main/java/no/sesat/search/view/velocity/BoldWordDirective.java
===================================================================
--- 
branches/2.18/generic.sesam/velocity-directives/src/main/java/no/sesat/search/view/velocity/BoldWordDirective.java
  2009-02-05 15:37:06 UTC (rev 7197)
+++ 
branches/2.18/generic.sesam/velocity-directives/src/main/java/no/sesat/search/view/velocity/BoldWordDirective.java
  2009-02-11 18:21:57 UTC (rev 7198)
@@ -1,4 +1,4 @@
-/* Copyright (2007-2008) Schibsted Søk AS
+/* Copyright (2007-2009) Schibsted Søk AS
  * This file is part of SESAT.
  *
  *   SESAT is free software: you can redistribute it and/or modify
@@ -50,7 +50,7 @@
  *
  * @version $Id$
  */
-public final class BoldWordDirective extends Directive {
+public final class BoldWordDirective extends AbstractDirective {
 
     private static final Logger LOG = 
Logger.getLogger(BoldWordDirective.class);
 
@@ -74,8 +74,8 @@
 
         if (argCount != 1) {
 
-            String text = node.jjtGetChild(0).value(context).toString();
-            final String uquery = 
node.jjtGetChild(1).value(context).toString();
+            String text = getArgument(context, node, 0);
+            final String uquery = getArgument(context, node, 1);
             String query = 
org.apache.commons.lang.StringEscapeUtils.unescapeHtml(uquery);
 
             if(text == null) {
@@ -105,7 +105,6 @@
 
             final String msg = '#' + getName() + " - wrong number of 
arguments";
             LOG.error(msg);
-            rsvc.error(msg);
             return false;
         }
 

_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits

Reply via email to