Skip to content
Snippets Groups Projects
Commit bc83bbc3 authored by bontric's avatar bontric
Browse files

fix missing null check

parent 2e99baad
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -4,6 +4,7 @@ import org.briarproject.bramble.api.contact.Contact;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.contact.ContactManager;
import org.briarproject.bramble.api.contact.ContactType;
import org.briarproject.bramble.api.contact.PrivateMailbox;
import org.briarproject.bramble.api.contact.event.ContactAddedEvent;
import org.briarproject.bramble.api.db.DatabaseComponent;
import org.briarproject.bramble.api.db.DbException;
......@@ -95,7 +96,9 @@ public class MailboxServiceImpl implements MailboxService, EventListener {
LOG.info("Starting Mailbox Service");
try {
privateMailboxId = contactManager.getPrivateMailbox().getId();
PrivateMailbox mb = contactManager.getPrivateMailbox();
if (mb!=null)
privateMailboxId = mb.getId();
} catch (DbException e1) {
if (LOG.isLoggable(WARNING))
LOG.info(e1.toString());
......@@ -129,7 +132,9 @@ public class MailboxServiceImpl implements MailboxService, EventListener {
if (hasPrivateMailbox.get())
return;
try {
privateMailboxId = contactManager.getPrivateMailbox().getId();
PrivateMailbox mb = contactManager.getPrivateMailbox();
if (mb!=null)
privateMailboxId = mb.getId();
} catch (DbException e1) {
if (LOG.isLoggable(WARNING))
LOG.info(e1.toString());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment