From e62b0ca320fb2dab67d6e280984343dbf997b18c Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 22 Jan 2018 23:20:58 +0100 Subject: [PATCH] fix NPE when writing Resolver.Result to disk --- src/main/java/eu/siacs/conversations/utils/Resolver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/utils/Resolver.java b/src/main/java/eu/siacs/conversations/utils/Resolver.java index 3bf2f1e08..d12b95368 100644 --- a/src/main/java/eu/siacs/conversations/utils/Resolver.java +++ b/src/main/java/eu/siacs/conversations/utils/Resolver.java @@ -311,7 +311,7 @@ public class Resolver { public ContentValues toContentValues() { final ContentValues contentValues = new ContentValues(); - contentValues.put(IP, ip.getAddress()); + contentValues.put(IP, ip == null ? null : ip.getAddress()); contentValues.put(HOSTNAME, hostname.toString()); contentValues.put(PORT, port); contentValues.put(PRIORITY, priority);