diff --git a/src/main/java/com/loafle/overflow/crawler/result/OFResultSetCol.java b/src/main/java/com/loafle/overflow/crawler/result/OFResultSetCol.java index a3d5ecf..8aa0f5a 100644 --- a/src/main/java/com/loafle/overflow/crawler/result/OFResultSetCol.java +++ b/src/main/java/com/loafle/overflow/crawler/result/OFResultSetCol.java @@ -27,11 +27,14 @@ public class OFResultSetCol extends OFResultSet{ this.meta.put(meta.get(indexI), indexI); } - for( int indexI = 0 ; indexI < arrayColumns.size(); ++indexI) { - this.meta.put(arrayColumns.get(indexI), indexI+ meta.size()); + if( arrayColumns != null) { + for( int indexI = 0 ; indexI < arrayColumns.size(); ++indexI) { + this.meta.put(arrayColumns.get(indexI), indexI+ meta.size()); + } } + } public Map parse() { @@ -57,13 +60,16 @@ public class OFResultSetCol extends OFResultSet{ arrayValue.clear(); - for(int indexL =0; indexL < arrayColumns.size(); ++indexL) { - columnIdx = this.meta.get(arrayColumns.get(indexL)); + if(arrayColumns != null ) { + for(int indexL =0; indexL < arrayColumns.size(); ++indexL) { + columnIdx = this.meta.get(arrayColumns.get(indexL)); - arrayValue.add(row.get(columnIdx)); + arrayValue.add(row.get(columnIdx)); + } } + for(int indexK = 0 ; indexK < metrics.size(); ++indexK) { metric = metrics.get(indexK); @@ -83,6 +89,10 @@ public class OFResultSetCol extends OFResultSet{ private String convertMetric(String metric, List arrayValue) { + if(arrayValue == null || arrayValue.size() <= 0) { + return metric; + } + String convertChar = "$"; String convertStr = null;