#3436, #3441: Check if server icon image is null

This commit is contained in:
Outfluencer 2023-03-15 08:44:36 +01:00 committed by GitHub
parent f4534c8273
commit 7790783949
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,6 @@
package net.md_5.bungee.api; package net.md_5.bungee.api;
import com.google.common.base.Preconditions;
import com.google.common.io.BaseEncoding; import com.google.common.io.BaseEncoding;
import com.google.gson.TypeAdapter; import com.google.gson.TypeAdapter;
import com.google.gson.internal.bind.TypeAdapters; import com.google.gson.internal.bind.TypeAdapters;
@ -59,6 +60,7 @@ public class Favicon
*/ */
public static Favicon create(BufferedImage image) public static Favicon create(BufferedImage image)
{ {
Preconditions.checkArgument( image != null, "image is null" );
// check size // check size
if ( image.getWidth() != 64 || image.getHeight() != 64 ) if ( image.getWidth() != 64 || image.getHeight() != 64 )
{ {