From c08d2d9d5bb6bea2e9ab7ac07342d39c2a7afc7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=B8=87=E7=A8=8B?= <1498425439@qq.com> Date: Sun, 21 Jan 2024 16:18:47 +0800 Subject: [PATCH] fix(Cache): ignore IllegalStateException ProjectImpl.getEarlyDisposable must not return null --- .../github/linwancen/plugin/show/cache/LineEndCacheUtils.java | 3 +++ .../io/github/linwancen/plugin/show/cache/TreeCacheUtils.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/main/java/io/github/linwancen/plugin/show/cache/LineEndCacheUtils.java b/src/main/java/io/github/linwancen/plugin/show/cache/LineEndCacheUtils.java index 621945f..d030160 100644 --- a/src/main/java/io/github/linwancen/plugin/show/cache/LineEndCacheUtils.java +++ b/src/main/java/io/github/linwancen/plugin/show/cache/LineEndCacheUtils.java @@ -132,6 +132,9 @@ public class LineEndCacheUtils { } }).inSmartMode(project).executeSynchronously(); })); + } catch (IllegalStateException ignore) { + // ignore inSmartMode(project) throw: + // @NotNull method com/intellij/openapi/project/impl/ProjectImpl.getEarlyDisposable must not return null } catch (Exception e) { LOG.info("LineEndCacheUtils cache.forEach catch Throwable but log to record.", e); } diff --git a/src/main/java/io/github/linwancen/plugin/show/cache/TreeCacheUtils.java b/src/main/java/io/github/linwancen/plugin/show/cache/TreeCacheUtils.java index 17303f8..7ccc5cf 100644 --- a/src/main/java/io/github/linwancen/plugin/show/cache/TreeCacheUtils.java +++ b/src/main/java/io/github/linwancen/plugin/show/cache/TreeCacheUtils.java @@ -84,6 +84,9 @@ public class TreeCacheUtils { }).inSmartMode(project).executeSynchronously(); } }); + } catch (IllegalStateException ignore) { + // ignore inSmartMode(project) throw: + // @NotNull method com/intellij/openapi/project/impl/ProjectImpl.getEarlyDisposable must not return null } catch (Exception e) { LOG.info("TreeCacheUtils cache.forEach catch Throwable but log to record.", e); }