diff --git a/CHANGELOG.md b/CHANGELOG.md index c4cf928..7baab09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## [v1.0.5] + +- Avoid errors during `onProjectStatusChanged`, as the OMT menus could sometime not be present. + ## [v1.0.4] ### Changed diff --git a/src/main/java/net/briac/omegat/plugin/omt/ManageOMTPackage.java b/src/main/java/net/briac/omegat/plugin/omt/ManageOMTPackage.java index d27c3dc..af35b5f 100644 --- a/src/main/java/net/briac/omegat/plugin/omt/ManageOMTPackage.java +++ b/src/main/java/net/briac/omegat/plugin/omt/ManageOMTPackage.java @@ -117,8 +117,12 @@ public static void unloadPlugins() { } private static void onProjectStatusChanged(boolean isProjectLoaded) { - exportOMT.setEnabled(isProjectLoaded); - importOMT.setEnabled(!isProjectLoaded); + if (exportOMT != null) { + exportOMT.setEnabled(isProjectLoaded); + } + if (importOMT != null) { + importOMT.setEnabled(!isProjectLoaded); + } } public static void projectImportOMT() {