From 3b9ac9f411f6e8f646dcebc18cc01470cf98c8e4 Mon Sep 17 00:00:00 2001 From: Andriy Trubchanin Date: Mon, 29 Nov 2021 17:20:55 +0200 Subject: [PATCH] fix attributes compare --- lib/src/models/quill_delta.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/src/models/quill_delta.dart b/lib/src/models/quill_delta.dart index 47bbde2a..e4a11055 100644 --- a/lib/src/models/quill_delta.dart +++ b/lib/src/models/quill_delta.dart @@ -150,6 +150,11 @@ class Operation { /// Returns `true` if [other] operation has the same attributes as this one. bool hasSameAttributes(Operation other) { + // treat null and empty equal + if ((_attributes?.isEmpty ?? true) && + (other._attributes?.isEmpty ?? true)) { + return true; + } return _attributeEquality.equals(_attributes, other._attributes); }