Skip to content

Commit 9e15bfc

Browse files
committed
Handle both null in Document.equals
1 parent 447ea01 commit 9e15bfc

File tree

1 file changed

+3
-1
lines changed
  • core/src/main/java/software/amazon/smithy/java/core/serde/document

1 file changed

+3
-1
lines changed

core/src/main/java/software/amazon/smithy/java/core/serde/document/Document.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,9 @@ static boolean equals(Object left, Object right) {
683683
* @return true if they are equal.
684684
*/
685685
static boolean equals(Object left, Object right, int options) {
686-
if (left instanceof Document l && right instanceof Document r) {
686+
if (left == null && right == null) {
687+
return true;
688+
} else if (left instanceof Document l && right instanceof Document r) {
687689
if (l == r) {
688690
return true;
689691
}

0 commit comments

Comments
 (0)