From 1d3da2623a113f74f76422030af040a0abc9c3d7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 15 Mar 2015 13:41:42 +0100 Subject: [PATCH] React to dedicated exception differently --- src/main/java/net/pterodactylus/sone/core/SoneParser.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/core/SoneParser.java b/src/main/java/net/pterodactylus/sone/core/SoneParser.java index e234965..ae600a6 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneParser.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneParser.java @@ -21,6 +21,7 @@ import net.pterodactylus.sone.data.Post; import net.pterodactylus.sone.data.PostReply; import net.pterodactylus.sone.data.Profile; import net.pterodactylus.sone.data.Profile.DuplicateField; +import net.pterodactylus.sone.data.Profile.EmptyFieldName; import net.pterodactylus.sone.data.Sone; import net.pterodactylus.sone.database.PostBuilder; import net.pterodactylus.sone.database.PostReplyBuilder; @@ -151,6 +152,9 @@ public class SoneParser { } try { profile.addField(fieldName.trim()).setValue(fieldValue); + } catch (EmptyFieldName efn1) { + logger.log(Level.WARNING, "Empty field name!", efn1); + return null; } catch (DuplicateField df1) { logger.log(Level.WARNING, String.format("Duplicate field: %s", fieldName), df1); return null; -- 2.7.4