root.toDelta check replaced with assertion

pull/1964/head
Alspb 9 months ago
parent edc6a42bf7
commit b48cbf6e0a
  1. 6
      lib/src/models/documents/document.dart

@ -334,10 +334,7 @@ class Document {
} catch (e) {
throw StateError('_delta compose failed');
}
if (_delta != _root.toDelta()) {
throw StateError('Compose failed');
}
assert(_delta == _root.toDelta(), 'Compose failed');
final change = DocChange(originalDelta, delta, changeSource);
documentChangeObserver.add(change);
history.handleDocChange(change);
@ -422,7 +419,6 @@ class Document {
doc.toString(), 'Document Delta cannot be empty.');
}
// print(doc.last.data.runtimeType);
assert((doc.last.data as String).endsWith('\n'));
var offset = 0;

Loading…
Cancel
Save