File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
src/main/java/software/xdev/saveactions/model Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1+ ## 1.4.2
2+ * Fix storage deserialization crash on unknown actions value #273
3+
14## 1.4.1
25* Fix `` Add class qualifier to static member access outside declaring class `` not working correctly for `` switch `` statements #263
36
Original file line number Diff line number Diff line change 11package software .xdev .saveactions .model ;
22
33import java .util .ArrayList ;
4- import java .util .EnumSet ;
54import java .util .HashSet ;
65import java .util .List ;
76import java .util .Objects ;
@@ -31,7 +30,9 @@ public final class Storage implements PersistentStateComponent<Storage>
3130 public Storage ()
3231 {
3332 this .firstLaunch = true ;
34- this .actions = EnumSet .noneOf (Action .class );
33+ // Must use a set that support nullable values!
34+ // For example EnumSet will crash when encountering an unknown/null value
35+ this .actions = new HashSet <>();
3536 this .exclusions = new HashSet <>();
3637 this .inclusions = new HashSet <>();
3738 this .configurationPath = null ;
@@ -42,7 +43,7 @@ public Storage()
4243 public Storage (final Storage storage )
4344 {
4445 this .firstLaunch = storage .firstLaunch ;
45- this .actions = EnumSet . copyOf (storage .actions );
46+ this .actions = new HashSet <> (storage .actions );
4647 this .exclusions = new HashSet <>(storage .exclusions );
4748 this .inclusions = new HashSet <>(storage .inclusions );
4849 this .configurationPath = storage .configurationPath ;
You can’t perform that action at this time.
0 commit comments