This commit is contained in:
embeddedt 2023-04-16 13:21:10 -04:00
parent f8c5c50ce4
commit 3497adfa6d
No known key found for this signature in database
GPG Key ID: A69433EC199B5613
2 changed files with 3 additions and 2 deletions

View File

@ -82,7 +82,7 @@ public abstract class ModFileResourcePackMixin {
}
private boolean isValidCachedResourcePath(Path path) {
if(path.getFileName() == null) {
if(path.getFileName() == null || path.getNameCount() == 0) {
return false;
}
String str = path.toString();

View File

@ -29,7 +29,8 @@ public class CachedResourcePath {
}
public CachedResourcePath(String s) {
this(NO_PREFIX, SLASH_SPLITTER.splitToList(s));
// normalize so we can guarantee there are no empty sections
this(NO_PREFIX, SLASH_SPLITTER.splitToList(FileUtil.normalize(s)));
}
public <T> CachedResourcePath(String[] prefixElements, Collection<T> collection) {