TeaVM startup crash fixed

This commit is contained in:
Andrea Cavalli 2018-08-28 02:49:57 +02:00
parent 1f99bad087
commit 8a7e4f29f3
2 changed files with 5 additions and 4 deletions

View File

@ -31,7 +31,6 @@ import org.apache.commons.io.Charsets;
import org.apache.commons.io.IOUtils;
import org.teavm.classlib.java.nio.charset.TCharset;
import org.teavm.jso.browser.Window;
import org.warp.picalculator.Main;
public class StorageUtils {
public static final String basepath;

View File

@ -30,9 +30,11 @@ public class CacheUtils {
private static void refreshEntry(String entryName) {
synchronized (time) {
synchronized (cache) {
if (time.getOrDefault(entryName, 0L) <= System.currentTimeMillis()) {
time.remove(entryName);
cache.remove(entryName);
if (time.containsKey(entryName)) {
if (time.get(entryName) <= System.currentTimeMillis()) {
time.remove(entryName);
cache.remove(entryName);
}
}
}
}