Fix Effort null pointers

Trap a coupld of null pointer exceptions which get thrown when there are
no acoustic data.
This commit is contained in:
Douglas Gillespie 2023-12-22 13:38:18 +00:00
parent 56bab82be3
commit e29f6f0589

View File

@ -44,6 +44,9 @@ public class EffortFunctions {
private DeploymentOverview createOverview(RecordingList tempPeriods) { private DeploymentOverview createOverview(RecordingList tempPeriods) {
DutyCycleInfo dutyCycleinfo = assessDutyCycle(tempPeriods); DutyCycleInfo dutyCycleinfo = assessDutyCycle(tempPeriods);
if (dutyCycleinfo == null) {
return null;
}
// if it's duty cycles, then we only want a single entry. // if it's duty cycles, then we only want a single entry.
RecordingList deploymentPeriods; RecordingList deploymentPeriods;
@ -274,6 +277,9 @@ public class EffortFunctions {
* @return * @return
*/ */
private DutyCycleInfo assessDutyCycle(RecordingList tempPeriods) { private DutyCycleInfo assessDutyCycle(RecordingList tempPeriods) {
if (tempPeriods == null) {
return null;
}
int n = tempPeriods.size(); int n = tempPeriods.size();
if (n < 2) { if (n < 2) {
return new DutyCycleInfo(false, 0,0,n); return new DutyCycleInfo(false, 0,0,n);