Skip to content

Commit

Permalink
Handling invalid editor states from preview releases (#1636)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahus1 committed Jun 24, 2024
1 parent 1d885f6 commit 92996dd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ This document provides a high-level view of the changes introduced by release.
[[releasenotes]]
== Release notes

=== 0.42.2

- Handling invalid editor states from preview releases (#1636)

=== 0.42.1

- Reworking the changes for EAP, restoring preview and menu bar functionality (#1636)
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/org/asciidoc/intellij/ui/SplitFileEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,12 @@ public void setState(@NotNull FileEditorState state) {
mySecondEditor.setState(compositeState.getSecondState());
}
if (compositeState.getSplitLayout() != null) {
mySplitEditorLayout = SplitEditorLayout.valueOf(compositeState.getSplitLayout());
try {
mySplitEditorLayout = SplitEditorLayout.valueOf(compositeState.getSplitLayout());
} catch (IllegalArgumentException ignore) {
// found an obsolete or old value, using the default value
mySplitEditorLayout = AsciiDocApplicationSettings.getInstance().getAsciiDocPreviewSettings().getSplitEditorLayout();
}
invalidateLayout();
}
}
Expand Down

0 comments on commit 92996dd

Please sign in to comment.