From 1d5c7a5314f0d00a9508dca3087e37759d2ac480 Mon Sep 17 00:00:00 2001 From: Andy Trand <magtuxgit@gmail.com> Date: Mon, 29 Nov 2021 18:31:45 +0200 Subject: [PATCH] fix attributes compare (#486) --- 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); }