Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor crashes if first character typed is an emoji, when plugged with pattern, stable or action tags plugin #1863

Open
BazinC opened this issue Feb 28, 2024 · 0 comments 路 May be fixed by #1891
Labels
type_bug Something isn't working

Comments

@BazinC
Copy link

BazinC commented Feb 28, 2024

Package Version
GitHub, stable branch

To Reproduce
Steps to reproduce the behavior:

  1. Run the example and open "In the Lab" Hash Tags, User Tags or Action Tags page
  2. Type an emoji as your first character, e.g: 馃挋
  3. Editor doesn't display the character and no longer accept any other user input
See error:
鈺愨晲鈺愨晲鈺愨晲鈺愨晲 Exception caught by services library 鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲
The following _TypeError was thrown during method call TextInputClient.updateEditingStateWithDeltas:
Null check operator used on a null value

When the exception was thrown, this was the stack:
#0      TagFinder.findTagAroundPosition (package:super_editor/src/default_editor/text_tokenizing/tags.dart:40:95)
tags.dart:40
#1      PatternTagReaction._findTagAtCaret (package:super_editor/src/default_editor/text_tokenizing/pattern_tags.dart:292:22)
pattern_tags.dart:292
#2      PatternTagReaction._adjustTagAttributionsAroundAlteredTags (package:super_editor/src/default_editor/text_tokenizing/pattern_tags.dart:244:17)
pattern_tags.dart:244
#3      PatternTagReaction.react (package:super_editor/src/default_editor/text_tokenizing/pattern_tags.dart:218:5)
pattern_tags.dart:218
#4      Editor._reactToChanges (package:super_editor/src/core/editor.dart:218:16)
editor.dart:218
#5      Editor.execute (package:super_editor/src/core/editor.dart:161:9)
editor.dart:161
#6      TextDeltasDocumentEditor._insertPlainText (package:super_editor/src/default_editor/document_ime/document_delta_editing.dart:342:12)
document_delta_editing.dart:342
#7      TextDeltasDocumentEditor.insert (package:super_editor/src/default_editor/document_ime/document_delta_editing.dart:294:23)
document_delta_editing.dart:294
#8      TextDeltasDocumentEditor._applyInsertion (package:super_editor/src/default_editor/document_ime/document_delta_editing.dart:171:5)
document_delta_editing.dart:171
#9      TextDeltasDocumentEditor.applyDeltas (package:super_editor/src/default_editor/document_ime/document_delta_editing.dart:80:9)
document_delta_editing.dart:80
#10     DocumentImeInputClient.updateEditingValueWithDeltas (package:super_editor/src/default_editor/document_ime/document_ime_communication.dart:219:30)
document_ime_communication.dart:219
#11     DeltaTextInputClientDecorator.updateEditingValueWithDeltas (package:super_editor/src/default_editor/document_ime/ime_decoration.dart:124:14)
ime_decoration.dart:124
#12     TextInput._handleTextInputInvocation (package:flutter/src/services/text_input.dart:1876:63)
text_input.dart:1876
#13     TextInput._loudlyHandleTextInputInvocation (package:flutter/src/services/text_input.dart:1765:20)
text_input.dart:1765
#14     MethodChannel._handleAsMethodCall (package:flutter/src/services/platform_channel.dart:571:55)
platform_channel.dart:571
#15     MethodChannel.setMethodCallHandler.<anonymous closure> (package:flutter/src/services/platform_channel.dart:564:34)
platform_channel.dart:564
#16     _DefaultBinaryMessenger.setMessageHandler.<anonymous closure> (package:flutter/src/services/binding.dart:603:35)
binding.dart:603
#17     _invoke2 (dart:ui/hooks.dart:344:13)
hooks.dart:344
#18     _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:45:5)
channel_buffers.dart:45
#19     _Channel.push (dart:ui/channel_buffers.dart:135:31)
channel_buffers.dart:135
#20     ChannelBuffers.push (dart:ui/channel_buffers.dart:343:17)
channel_buffers.dart:343
#21     PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:737:22)
platform_dispatcher.dart:737
#22     _dispatchPlatformMessage (dart:ui/hooks.dart:257:31)
hooks.dart:257

call: MethodCall(TextInputClient.updateEditingStateWithDeltas, [1, {deltas: [{selectionBase: 4, oldText: . , selectionAffinity: TextAffinity.downstream, deltaEnd: 2, deltaText: 馃挋, deltaStart: 2, composingExtent: -1, selectionIsDirectional: false, selectionExtent: 4, composingBase: -1}]}])
鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲鈺愨晲

Actual behavior
What's the result of repeating the steps above?

Expected behavior
What should be the result of repeating the steps above (the desired behavior)?

Platform
mobile and desktop

Flutter version
Tested with 3.16 and 3.19

@BazinC BazinC added the type_bug Something isn't working label Feb 28, 2024
BazinC added a commit to BazinC/super_editor that referenced this issue Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type_bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant