From bfe7398e173f8944f6a9191a64caf6f14a5eded5 Mon Sep 17 00:00:00 2001 From: huanghongxun Date: Tue, 18 Dec 2018 13:44:30 +0800 Subject: [PATCH] Fixed #501 --- .../java/org/jackhuang/hmcl/game/AccountHelper.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/game/AccountHelper.java b/HMCL/src/main/java/org/jackhuang/hmcl/game/AccountHelper.java index 007ffd57b..272487732 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/game/AccountHelper.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/game/AccountHelper.java @@ -75,6 +75,9 @@ public final class AccountHelper { File file = getSkinFile(uuid); if (file.exists()) { Image original = new Image("file:" + file.getAbsolutePath()); + if (original.isError()) + return getDefaultSkin(uuid, scaleRatio); + return new Image("file:" + file.getAbsolutePath(), original.getWidth() * scaleRatio, original.getHeight() * scaleRatio, @@ -154,8 +157,11 @@ public final class AccountHelper { if (account.getCharacter() == null) return; File file = getSkinFile(account.getUUID()); - if (!refresh && file.exists()) - return; + if (!refresh && file.exists()) { + Image original = new Image("file:" + file.getAbsolutePath()); + if (!original.isError()) + return; + } Optional texture = account.getSkin(); if (!texture.isPresent()) return; String url = texture.get().getUrl();