From: David ‘Bombe’ Roden Date: Sun, 15 Mar 2015 12:41:42 +0000 (+0100) Subject: React to dedicated exception differently X-Git-Tag: 0.9-rc1^2~3^2 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=1d3da2623a113f74f76422030af040a0abc9c3d7;p=Sone.git React to dedicated exception differently --- 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;