Merge remote-tracking branch 'origin/main' into 1.18

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

View File

@ -92,7 +92,7 @@ public abstract class PathResourcePackMixin {
}
private boolean isValidCachedResourcePath(Path path) {
if(path.getFileName() == null)
if(path.getFileName() == null || path.getNameCount() == 0)
return false;
String str = path.toString();
for(int i = 0; i < str.length(); i++) {

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) {