X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FSoneParser.java;fp=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fcore%2FSoneParser.java;h=03237964842fa7b0d34177cbcb605e84e783c1cb;hp=6983d255d6da2f603805baac40e6f250754f1a35;hb=3752ebf20fcb0c71287f2b7fed358b14c7649d7f;hpb=f333f58180a7f112394cd768d86c95a3c9edf794 diff --git a/src/main/java/net/pterodactylus/sone/core/SoneParser.java b/src/main/java/net/pterodactylus/sone/core/SoneParser.java index 6983d25..0323796 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneParser.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneParser.java @@ -106,18 +106,20 @@ public class SoneParser { logger.log(Level.WARNING, String.format("Downloaded Sone %s with invalid time: %s", originalSone, soneTime)); return null; } - Sone sone = soneBuilder.build(); SimpleXML clientXml = soneXml.getNode("client"); if (clientXml != null) { String clientName = clientXml.getValue("name", null); String clientVersion = clientXml.getValue("version", null); if ((clientName == null) || (clientVersion == null)) { - logger.log(Level.WARNING, String.format("Download Sone %s with client XML but missing name or version!", sone)); + logger.log(Level.WARNING, String.format("Download Sone %s with client XML but missing name or version!", originalSone)); return null; } - sone.setClient(new Client(clientName, clientVersion)); + soneBuilder.using(new Client(clientName, clientVersion)); + } else { + soneBuilder.using(new Client("Unknown Client", "0.0")); } + Sone sone = soneBuilder.build(); SimpleXML profileXml = soneXml.getNode("profile"); if (profileXml == null) {