Skip to content

Commit 92996dd

Browse files
committed
Handling invalid editor states from preview releases (#1636)
1 parent 1d885f6 commit 92996dd

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Diff for: CHANGELOG.adoc

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ This document provides a high-level view of the changes introduced by release.
77
[[releasenotes]]
88
== Release notes
99

10+
=== 0.42.2
11+
12+
- Handling invalid editor states from preview releases (#1636)
13+
1014
=== 0.42.1
1115

1216
- Reworking the changes for EAP, restoring preview and menu bar functionality (#1636)

Diff for: src/main/java/org/asciidoc/intellij/ui/SplitFileEditor.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,12 @@ public void setState(@NotNull FileEditorState state) {
202202
mySecondEditor.setState(compositeState.getSecondState());
203203
}
204204
if (compositeState.getSplitLayout() != null) {
205-
mySplitEditorLayout = SplitEditorLayout.valueOf(compositeState.getSplitLayout());
205+
try {
206+
mySplitEditorLayout = SplitEditorLayout.valueOf(compositeState.getSplitLayout());
207+
} catch (IllegalArgumentException ignore) {
208+
// found an obsolete or old value, using the default value
209+
mySplitEditorLayout = AsciiDocApplicationSettings.getInstance().getAsciiDocPreviewSettings().getSplitEditorLayout();
210+
}
206211
invalidateLayout();
207212
}
208213
}

0 commit comments

Comments
 (0)