r51264 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51263‎ | r51264 | r51265 >
Date:22:39, 31 May 2009
Author:rainman
Status:deferred
Tags:
Comment:
Check for null pointer exception here.
Modified paths:
  • /branches/lucene-search-2.1/src/org/wikimedia/lsearch/search/SearcherCache.java (modified) (history)

Diff [purge]

Index: branches/lucene-search-2.1/src/org/wikimedia/lsearch/search/SearcherCache.java
@@ -608,10 +608,12 @@
609609 Configuration config = Configuration.open();
610610 searchPoolSize = config.getInt("SearcherPool","size",1);
611611 String[] specials = config.getArray("SearcherPool", "special");
612 - for(String s : specials){
613 - String[] parts = s.split(":");
614 - if(parts.length == 2)
615 - specialPoolSizes.put( parts[0].trim(), new Integer(parts[1].trim()));
 612+ if( specials != null){
 613+ for(String s : specials){
 614+ String[] parts = s.split(":");
 615+ if(parts.length == 2)
 616+ specialPoolSizes.put( parts[0].trim(), new Integer(parts[1].trim()));
 617+ }
616618 }
617619 initialDeploymentThreads = config.getInt("SearcherPool", "initThreads",1);
618620 if(initialize){

Status & tagging log