mirror of
https://github.com/PAMGuard/PAMGuard.git
synced 2024-11-22 07:02:29 +00:00
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:
parent
56bab82be3
commit
e29f6f0589
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user