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); }