新增获取图片时的报错提示
All checks were successful
Java CI-CD with Maven / build (push) Successful in 6m54s

This commit is contained in:
zhangyuheng 2024-08-24 19:17:35 +08:00
parent 7744442575
commit dfb821ca23
2 changed files with 5 additions and 1 deletions

View File

@ -6,7 +6,7 @@
<groupId>cn.lunadeer</groupId>
<artifactId>ColorfulMap</artifactId>
<version>2.3</version>
<version>2.4</version>
<packaging>jar</packaging>
<name>ColorfulMap</name>

View File

@ -31,6 +31,10 @@ public class Multi {
}
URL _url = new URL(url);
BufferedImage raw_image = ImageIO.read(_url);
if (raw_image == null) {
Notification.error(player, "无法读取有效图片,请检查图片地址是否正确或者更换图床");
return null;
}
BufferedImage resized_image;
if (scale != 1.0) {
resized_image = ImageTool.resize(raw_image, scale);