Commit b846cf52 authored by Stephane Dallongeville's avatar Stephane Dallongeville
Browse files

Fixed possible NPE on exception handling

parent 1f8d60eb
......@@ -339,7 +339,7 @@ public class ActiveContours extends EzPlug implements EzStoppable, Block
private final HashMap<TrackSegment, Double> volumes = new HashMap<TrackSegment, Double>();
public final EzVarBoolean volume_constraint = new EzVarBoolean("Volume constraint", false);
public final EzVarDouble volume_weight = new EzVarDouble("Volume weight", 0.01, 0,1, 0.01);
public final EzVarDouble volume_weight = new EzVarDouble("Volume weight", 0.01, 0, 1, 0.01);
public final EzButton showTrackManager;
......@@ -615,7 +615,7 @@ public class ActiveContours extends EzPlug implements EzStoppable, Block
for (int t = startT; t <= endT; t++)
{
int iteration;
// if sizeT changed during AC processing (i already did it to shorthen processing time :p)
if (t >= inputData.getSizeT())
break;
......@@ -1491,11 +1491,11 @@ public class ActiveContours extends EzPlug implements EzStoppable, Block
}
// we disabled volume constraint feature as it doesn't work and sometime end to crazy contour (Stephane)
// re-enabled volume constraint after taking into account both shrinking and growing contours instead of just growing ones(Daniel)
// re-enabled volume constraint after taking into account both shrinking and growing contours instead of just growing ones(Daniel)
if (volume_constraint.getValue() && volumes.containsKey(segment))
{
contour.computeVolumeConstraint(volumes.get(segment), volume_weight.getValue());
}
{
contour.computeVolumeConstraint(volumes.get(segment), volume_weight.getValue());
}
}
else
{
......@@ -1514,7 +1514,7 @@ public class ActiveContours extends EzPlug implements EzStoppable, Block
}
catch (Exception e)
{
throw new RuntimeException(e.getCause());
throw new RuntimeException((e.getCause() != null) ? e.getCause() : e);
}
if (coupling_flag.getValue())
......@@ -1640,8 +1640,7 @@ public class ActiveContours extends EzPlug implements EzStoppable, Block
}
catch (Exception e)
{
e.getCause().printStackTrace();
throw new RuntimeException(e);
throw new RuntimeException((e.getCause() != null) ? e.getCause() : e);
}
}
......@@ -1675,8 +1674,7 @@ public class ActiveContours extends EzPlug implements EzStoppable, Block
}
catch (Exception e)
{
e.getCause().printStackTrace();
throw new RuntimeException(e);
throw new RuntimeException((e.getCause() != null) ? e.getCause() : e);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment