Skip to content

Commit 71b2f64

Browse files
authored
prevent NPE if decoration or paragraphDecoration are null (#283)
1 parent cd13f68 commit 71b2f64

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rta/src/main/java/com/gluonhq/richtextarea/model/DecorationModel.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, Gluon
2+
* Copyright (c) 2022, 2023, Gluon
33
*
44
* This program is free software: you can redistribute it and/or modify
55
* it under the terms of the GNU General Public License as published by
@@ -91,8 +91,8 @@ public boolean equals(Object o) {
9191
if (o == null || getClass() != o.getClass()) return false;
9292
DecorationModel that = (DecorationModel) o;
9393
return start == that.start && length == that.length &&
94-
decoration.equals(that.decoration) &&
95-
paragraphDecoration.equals(that.paragraphDecoration);
94+
Objects.equals(decoration, that.decoration) &&
95+
Objects.equals(paragraphDecoration, that.paragraphDecoration);
9696
}
9797

9898
@Override

0 commit comments

Comments
 (0)