diff --git a/apps/addressbook/java/src/net/i2p/addressbook/AddressBook.java b/apps/addressbook/java/src/net/i2p/addressbook/AddressBook.java index dedb388ccbb71c0a43b5659438767bf904ea1b62..c480d86889d00a305b09191984fcae3fe8af74b9 100644 --- a/apps/addressbook/java/src/net/i2p/addressbook/AddressBook.java +++ b/apps/addressbook/java/src/net/i2p/addressbook/AddressBook.java @@ -260,7 +260,7 @@ class AddressBook { * An AddressBook to merge with. * @param overwrite True to overwrite * @param log - * The log to write messages about new addresses or conflicts to. + * The log to write messages about new addresses or conflicts to. May be null. * * @throws IllegalStateException if this was created with the Subscription constructor. */ diff --git a/apps/addressbook/java/src/net/i2p/addressbook/Daemon.java b/apps/addressbook/java/src/net/i2p/addressbook/Daemon.java index 82509a643af541ce32c12e59ee4907d75999164e..968be726857abc1191f968909d361968fa2f7547 100644 --- a/apps/addressbook/java/src/net/i2p/addressbook/Daemon.java +++ b/apps/addressbook/java/src/net/i2p/addressbook/Daemon.java @@ -37,6 +37,7 @@ import net.i2p.client.naming.SingleFileNamingService; import net.i2p.data.DataFormatException; import net.i2p.data.Destination; import net.i2p.util.SecureDirectory; +import net.i2p.util.SystemVersion; /** * Main class of addressbook. Performs updates, and runs the main loop. @@ -168,7 +169,7 @@ public class Daemon { if (publishedNS == null) publishedNS = new SingleFileNamingService(I2PAppContext.getGlobalContext(), published.getAbsolutePath()); success = publishedNS.putIfAbsent(key, dest); - if (!success) { + if (log != null && !success) { try { log.append("Save to published address book " + published.getCanonicalPath() + " failed for new key " + key); } catch (IOException ioe) {} @@ -257,7 +258,7 @@ public class Daemon { SubscriptionList subscriptions = new SubscriptionList(subscriptionFile, etagsFile, lastModifiedFile, lastFetchedFile, delay, defaultSubs, settings .get("proxy_host"), Integer.parseInt(settings.get("proxy_port"))); - Log log = new Log(logFile); + Log log = SystemVersion.isAndroid() ? null : new Log(logFile); // If false, add hosts via naming service; if true, write hosts.txt file directly // Default false