Skip to content

Commit

Permalink
avoid null pointer when getting email for OAI-PMH #3619
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Jan 17, 2020
1 parent 804eac3 commit 024b8b2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import java.util.zip.DeflaterOutputStream;
import java.util.zip.GZIPOutputStream;
import javax.ejb.EJB;
import javax.mail.internet.InternetAddress;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
Expand Down Expand Up @@ -178,14 +179,14 @@ private RepositoryConfiguration createRepositoryConfiguration() {

String dataverseName = dataverseService.findRootDataverse().getName();
String repositoryName = StringUtils.isEmpty(dataverseName) || "Root".equals(dataverseName) ? "Test Dataverse OAI Archive" : dataverseName + " Dataverse OAI Archive";

InternetAddress internetAddress = MailUtil.parseSystemAddress(settingsService.getValueForKey(SettingsServiceBean.Key.SystemEmail));

RepositoryConfiguration repositoryConfiguration = new RepositoryConfiguration()
.withRepositoryName(repositoryName)
.withBaseUrl(systemConfig.getDataverseSiteUrl()+"/oai")
.withCompression("gzip") // ?
.withCompression("deflate") // ?
.withAdminEmail(MailUtil.parseSystemAddress(settingsService.getValueForKey(SettingsServiceBean.Key.SystemEmail)).getAddress())
.withAdminEmail(internetAddress != null ? internetAddress.getAddress() : null)
.withDeleteMethod(DeletedRecord.TRANSIENT)
.withGranularity(Granularity.Second)
.withMaxListIdentifiers(100)
Expand Down

0 comments on commit 024b8b2

Please sign in to comment.