diff --git a/CHANGELOG.md b/CHANGELOG.md index 4346f5a..742072c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ ### Fixed +- Fixed `NullPointerException` when plugin descriptor is not available during startup - Fixed `NoClassDefFoundError` in `CsvEditorSettings` - Fixed `java.lang.Throwable: ... Class initialization must not depend on services` by removing service access from class initializers and constructors - Fixed a `PluginException` (caused by `java.lang.IllegalArgumentException`) that occurred during early plugin initialization diff --git a/src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvPlugin.java b/src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvPlugin.java index 4dcdf6d..cfeca09 100644 --- a/src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvPlugin.java +++ b/src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvPlugin.java @@ -64,12 +64,13 @@ public void run(@NotNull ProgressIndicator progressIndicator) { doAsyncProjectMaintenance(project); NotificationGroup notificationGroup = NotificationGroupManager.getInstance().getNotificationGroup("net.seesharpsoft.intellij.plugins.csv"); - if (notificationGroup == null || CsvEditorSettings.getInstance().checkCurrentPluginVersion(CsvPluginManager.getVersion())) { + String version = CsvPluginManager.getVersion(); + if (version.isEmpty() || notificationGroup == null || CsvEditorSettings.getInstance().checkCurrentPluginVersion(version)) { return continuation; } Notification notification = notificationGroup.createNotification( - "CSV Editor " + CsvPluginManager.getVersion() + " - Change Notes", + "CSV Editor " + version + " - Change Notes", CsvPluginManager.getChangeNotes() + "

You can always customize plugin settings to your likings (shortcuts below)!

" + "
" + diff --git a/src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvPluginManager.java b/src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvPluginManager.java index 308e7af..57d08b3 100644 --- a/src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvPluginManager.java +++ b/src/main/java/net/seesharpsoft/intellij/plugins/csv/CsvPluginManager.java @@ -30,11 +30,13 @@ public static IdeaPluginDescriptor getPluginDescriptor() { } public static String getVersion() { - return getPluginDescriptor().getVersion(); + IdeaPluginDescriptor descriptor = getPluginDescriptor(); + return descriptor == null ? "" : descriptor.getVersion(); } public static String getChangeNotes() { - return getPluginDescriptor().getChangeNotes(); + IdeaPluginDescriptor descriptor = getPluginDescriptor(); + return descriptor == null ? "" : descriptor.getChangeNotes(); } private CsvPluginManager() {