Permalink
Browse files

fixes error handling urls with empty fields

  • Loading branch information...
1 parent abce175 commit 1f09364ae4db65d8398804eb82bf0e315ec571e4 @defg defg committed Apr 3, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/java/org/apache/nutch/util/TableUtil.java
@@ -119,11 +119,13 @@ public static String getReversedHost(String reversedUrl) {
}
private static void reverseAppendSplits(String[] splits, StringBuilder buf) {
- for (int i = splits.length - 1; i > 0; i--) {
- buf.append(splits[i]);
- buf.append('.');
+ if (splits.length > 0) {
+ for (int i = splits.length - 1; i > 0; i--) {
+ buf.append(splits[i]);
+ buf.append('.');
+ }
+ buf.append(splits[0]);
}
- buf.append(splits[0]);
}
/**

0 comments on commit 1f09364

Please sign in to comment.