diff --git a/search-services/alfresco-search/src/main/java/org/alfresco/solr/tracker/DocRouterFactory.java b/search-services/alfresco-search/src/main/java/org/alfresco/solr/tracker/DocRouterFactory.java index 591a05e31..f468f8d3f 100644 --- a/search-services/alfresco-search/src/main/java/org/alfresco/solr/tracker/DocRouterFactory.java +++ b/search-services/alfresco-search/src/main/java/org/alfresco/solr/tracker/DocRouterFactory.java @@ -35,17 +35,20 @@ public class DocRouterFactory public static DocRouter getRouter(Properties properties, ShardMethodEnum method) { - String shardDotId = properties.getProperty("shard.id"); - if (shardDotId != null && !shardDotId.isEmpty()) + if (properties != null) { - try + String shardDotId = properties.getProperty("shard.id"); + if (shardDotId != null && !shardDotId.isEmpty()) { - int shardid = Integer.parseInt(shardDotId); - log.info("Sharding via an ExplicitRouter for shard "+shardid); - return new ExplicitRouter(shardid); - } catch (NumberFormatException e) - { - log.error("Failed to parse a shard.id of "+shardDotId); + try + { + int shardid = Integer.parseInt(shardDotId); + log.info("Sharding via an ExplicitRouter for shard "+shardid); + return new ExplicitRouter(shardid); + } catch (NumberFormatException e) + { + log.error("Failed to parse a shard.id of "+shardDotId); + } } }