diff --git a/api/src/main/java/net/md_5/bungee/api/Favicon.java b/api/src/main/java/net/md_5/bungee/api/Favicon.java index db405b4e..0c9ec07e 100644 --- a/api/src/main/java/net/md_5/bungee/api/Favicon.java +++ b/api/src/main/java/net/md_5/bungee/api/Favicon.java @@ -14,6 +14,7 @@ import java.io.InputStream; import javax.imageio.ImageIO; import lombok.AccessLevel; import lombok.Getter; +import lombok.NonNull; import lombok.RequiredArgsConstructor; /** @@ -28,13 +29,14 @@ public class Favicon @Override public void write(JsonWriter out, Favicon value) throws IOException { - TypeAdapters.STRING.write( out, value.getEncoded() ); + TypeAdapters.STRING.write( out, value == null ? null : value.getEncoded() ); } @Override public Favicon read(JsonReader in) throws IOException { - return create( TypeAdapters.STRING.read( in ) ); + String enc = TypeAdapters.STRING.read( in ); + return enc == null ? null : create( enc ); } }; @@ -46,6 +48,7 @@ public class Favicon /** * The base64 encoded favicon, including MIME header. */ + @NonNull @Getter private final String encoded;