# HG changeset patch # User Tom Gottfried # Date 1429808801 -7200 # Node ID e4f9e2316e92813f819e4761036f8d177ea287b0 # Parent 582aaac447adbe8adc71424841287a0d2e60cdf4 Avoid NPE: fixRes is null if wqkms.lenght==0. diff -r 582aaac447ad -r e4f9e2316e92 artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixRealizingCompute.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixRealizingCompute.java Thu Apr 23 16:42:42 2015 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixRealizingCompute.java Thu Apr 23 19:06:41 2015 +0200 @@ -136,22 +136,24 @@ } } - DateFormat df = Formatter.getDateFormatter(context.getMeta(), "dd.MM.yyyy"); - DateFormat lf = Formatter.getDateFormatter(context.getMeta(), "dd.MM.yyyy'T'HH:mm"); - - Collection reds = fixRes.getReferenceEventsDates(); - UniqueDateFormatter cf = new UniqueDateFormatter(df, lf, reds); + if (wqkms.length > 0) { + DateFormat df = Formatter.getDateFormatter(context.getMeta(), + "dd.MM.yyyy"); + DateFormat lf = Formatter.getDateFormatter(context.getMeta(), + "dd.MM.yyyy'T'HH:mm"); - int i = 0; - for (Date d: reds) { - facets.add(new FixReferenceEventsFacet( - (1 << 9) | i, - FIX_EVENTS, - cf.format(d))); - i++; - } + Collection reds = fixRes.getReferenceEventsDates(); + UniqueDateFormatter cf = new UniqueDateFormatter(df, lf, reds); - if (wqkms.length > 0) { + int i = 0; + for (Date d: reds) { + facets.add(new FixReferenceEventsFacet( + (1 << 9) | i, + FIX_EVENTS, + cf.format(d))); + i++; + } + facets.add( new DataFacet(CSV, "CSV data", ComputeType.ADVANCE, hash, id));