Fix data loader issues

This commit is contained in:
cyberpwn 2022-01-14 08:11:09 -05:00
parent f2d1f7bf52
commit ebb1aaeefd

View File

@ -286,19 +286,23 @@ public class ResourceLoader<T extends IrisRegistrant> implements MeteredCache {
} }
public KList<File> getFolders() { public KList<File> getFolders() {
if(folderCache.get() == null) {
synchronized(folderCache)
{ synchronized(folderCache)
folderCache.set(new KList<>()); {
if(folderCache.get() == null) {
KList<File> fc = new KList<>();
for(File i : root.listFiles()) { for(File i : root.listFiles()) {
if(i.isDirectory()) { if(i.isDirectory()) {
if(i.getName().equals(folderName)) { if(i.getName().equals(folderName)) {
folderCache.get().add(i); fc.add(i);
break; break;
} }
} }
} }
folderCache.set(fc);
} }
} }