File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
HMCLCore/src/main/java/org/jackhuang/hmcl/auth/offline Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 23
23
import org .jackhuang .hmcl .task .FetchTask ;
24
24
import org .jackhuang .hmcl .task .GetTask ;
25
25
import org .jackhuang .hmcl .task .Task ;
26
+ import org .jackhuang .hmcl .util .Lang ;
26
27
import org .jackhuang .hmcl .util .StringUtils ;
27
28
import org .jackhuang .hmcl .util .gson .JsonUtils ;
28
29
import org .jackhuang .hmcl .util .io .FileUtils ;
@@ -165,7 +166,9 @@ public Task<LoadedSkin> load(String username) {
165
166
});
166
167
case LITTLE_SKIN :
167
168
case CUSTOM_SKIN_LOADER_API :
168
- String realCslApi = type == Type .LITTLE_SKIN ? "https://littleskin.cn" : StringUtils .removeSuffix (cslApi , "/" );
169
+ String realCslApi = type == Type .LITTLE_SKIN
170
+ ? "https://littleskin.cn"
171
+ : StringUtils .removeSuffix (Lang .requireNonNullElse (cslApi , "" ), "/" );
169
172
return Task .composeAsync (() -> new GetTask (new URL (String .format ("%s/%s.json" , realCslApi , username ))))
170
173
.thenComposeAsync (json -> {
171
174
SkinJson result = JsonUtils .GSON .fromJson (json , SkinJson .class );
You can’t perform that action at this time.
0 commit comments