Fixed possible NPE in data importer

This commit is contained in:
Frederik Petersen committed 2014-06-08 15:07:46 +02:00
1 parent ecc499981d
commit c18823acfe
1 file changed
+5 -1
@@ -987,7 +987,11 @@ public class RacingEventServiceImpl implements RacingEventServiceWithTestSupport
@Override
public void addRegattaWithoutReplication(Regatta regatta) {
boolean wasAdded = addAndConnectRegatta(regatta.isPersistent(), regatta.getDefaultCourseArea().getId(), regatta);
UUID defaultCourseAreaId = null;
if (regatta.getDefaultCourseArea() != null) {
defaultCourseAreaId = regatta.getDefaultCourseArea().getId();
}
boolean wasAdded = addAndConnectRegatta(regatta.isPersistent(), defaultCourseAreaId, regatta);
if (!wasAdded) {
logger.info("Regatta with name " + regatta.getName() + " already existed, so it hasn't been added.");
}