Fix 4232: 修复初始化 CacheRepository 导致启动器崩溃的问题 (#4235)
This commit is contained in:
@@ -71,7 +71,7 @@ public class DefaultCacheRepository extends CacheRepository {
|
|||||||
} else {
|
} else {
|
||||||
index = new Index();
|
index = new Index();
|
||||||
}
|
}
|
||||||
} catch (IOException | JsonParseException e) {
|
} catch (Exception e) {
|
||||||
LOG.warning("Unable to read index file", e);
|
LOG.warning("Unable to read index file", e);
|
||||||
index = new Index();
|
index = new Index();
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.jackhuang.hmcl.util;
|
package org.jackhuang.hmcl.util;
|
||||||
|
|
||||||
import com.google.gson.JsonParseException;
|
|
||||||
import com.google.gson.JsonSyntaxException;
|
import com.google.gson.JsonSyntaxException;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
import org.jackhuang.hmcl.util.function.ExceptionalSupplier;
|
import org.jackhuang.hmcl.util.function.ExceptionalSupplier;
|
||||||
@@ -75,7 +74,7 @@ public class CacheRepository {
|
|||||||
index = new LinkedHashMap<>();
|
index = new LinkedHashMap<>();
|
||||||
indexFileLastModified = null;
|
indexFileLastModified = null;
|
||||||
}
|
}
|
||||||
} catch (IOException | JsonParseException e) {
|
} catch (Exception e) {
|
||||||
LOG.warning("Unable to read index file", e);
|
LOG.warning("Unable to read index file", e);
|
||||||
index = new LinkedHashMap<>();
|
index = new LinkedHashMap<>();
|
||||||
indexFileLastModified = null;
|
indexFileLastModified = null;
|
||||||
@@ -354,7 +353,7 @@ public class CacheRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int compareTo(ETagItem other) {
|
public int compareTo(ETagItem other) {
|
||||||
if (!url.equals(other.url))
|
if (!url.equals(other.url) && !NetworkUtils.toURI(url).equals(NetworkUtils.toURI(other.url)))
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
|
|
||||||
ZonedDateTime thisTime = Lang.ignoringException(() -> ZonedDateTime.parse(remoteLastModified, DateTimeFormatter.RFC_1123_DATE_TIME), null);
|
ZonedDateTime thisTime = Lang.ignoringException(() -> ZonedDateTime.parse(remoteLastModified, DateTimeFormatter.RFC_1123_DATE_TIME), null);
|
||||||
|
|||||||
Reference in New Issue
Block a user