Skip to content

flutter_markdown null check operator used on a null value in MarkdownBuilder._buildRichText #146282

Closed
flutter/packages
#6883

Description

@bogdannedelcu

Steps to reproduce

Error: Null check operator used on a null value

ErrorDetails: 

Stacktrace: #0      MarkdownBuilder._buildRichText.<anonymous closure> (package:flutter_markdown/src/builder.dart:957)
#1      _SelectableTextState._handleSelectionChanged (package:flutter/src/material/selectable_text.dart:578)
#2      EditableTextState._handleSelectionChanged (package:flutter/src/widgets/editable
_text.dart:3695)
#3      EditableTextState._formatAndSetValue (package:flutter/src/widgets/editable_text.dart:3903)
#4      EditableTextState.userUpdateTextEditingValue (package:flutter/src/widgets/editable_text.dart:4271)
#5      RenderEditable._setTextEditingValue (package:flutter/src/rendering/editable.dart:734)
#6      RenderEditable._setSelection (package:flutter/src/rendering/editable.dart:753)
#7      RenderEditable.selectPositionAt (package:flutter/src/rendering/editable.dart:2090)
#8      RenderEditable.selectPosition (package:flutter/src/rendering/editable.dart:2067)
#9      _SelectableTextSelectionGestureDetectorBuilder.onSingleTapUp (package:flutter/src/material/selectable_text.dart:98)
#10     _TextSelectionGestureDetectorState._handleTapUp (package:flutter/src/widgets/text_selection.dart:3282)
#11     BaseTapAndDragGestureRecognizer._checkTapUp.<anonymous closure> (package:flutter/src/gestures/tap_and_drag.dart:1198)
#12     GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:315)
#13     BaseTapAndDragGestureRecognizer._checkTapUp (package:flutter/src/gestures/tap_and_drag.dart:1198)
#14     BaseTapAndDragGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap_and_drag.dart:996)
#15     GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:167)
#16     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:499)
#17     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:475)
#18     RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:430)
#19     GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:420)
#20     GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:383)
#21     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:330)
#22     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:299)
#23     _invoke1 (dart:ui/hooks.
dart:328)
#24     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:429)
#25     _dispatchPointerDataPacket (dart:ui/hooks.dart:262)

Expected results

No error

Actual results

Crash

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[!] Flutter (Channel stable, 3.19.1, on macOS 14.0 23A344 darwin-x64, locale ro-RO)
    • Flutter version 3.19.1 on channel stable at /Users/andreea/development/flutter
    ! Warning: `dart` on your path resolves to /usr/local/Cellar/dart/3.2.5/libexec/bin/dart, which is not inside
      your current Flutter SDK checkout at /Users/andreea/development/flutter. Consider adding
      /Users/andreea/development/flutter/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision abb292a07e (6 weeks ago), 2024-02-20 14:35:05 -0800
    • Engine revision 04817c99c9
    • Dart version 3.3.0
    • DevTools version 2.31.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git"
      directly to perform update checks and upgrades.
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1)
    • Android SDK at /Users/andreea/Library/Android/sdk
    • Platform android-34, build-tools 33.0.0-rc1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.13.0
[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
[✓] Connected device (3 available)
    • Hipp (mobile)   • 00008101-001445E12205001E • ios            • iOS 17.3.1 21D61
    • macOS (desktop) • macos                     • darwin-x64     • macOS 14.0 23A344 darwin-x64
    • Chrome (web)    • chrome                    • web-javascript • Google Chrome 123.0.6312.105
[✓] Network resources
    • All expected network resources are available.

Activity

  1. added
    in triagePresently being triaged by the triage team
    on Apr 5, 2024
  2. huycozy commented on Apr 5, 2024

    @huycozy
    Member

    Hi @bogdannedelcu
    Which flutter_markdown version are you using?

    Please provide Steps to reproduce and a minimal and complete sample code (but not your production/complex project) so that we can verify the issue. Thanks!

  3. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Apr 5, 2024
  4. bogdannedelcu commented on Apr 5, 2024

    @bogdannedelcu
    Author

    the screen where i get this error displays a readonly long rich text. It reproduces when you select text and drag around with the finger.

    flutter markdown 0.6.19 - i will upgrade and get back to you.

    I see line 957 in the source code which could be the source of the error, maybe some things should be checked for null

    image

  5. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Apr 5, 2024
  6. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Apr 5, 2024
  7. github-actions commented on Apr 26, 2024

    @github-actions

    Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
    If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
    Thanks for your contribution.

  8. github-actions commented on May 10, 2024

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  9. locked as resolved and limited conversation to collaborators on May 10, 2024
  10. added a commit that references this issue on Jun 18, 2024
    937038c
  11. added a commit that references this issue on Jan 23, 2025
    39f1ec8
  12. added a commit that references this issue on Jun 10, 2026
    e56ae52
  13. added a commit that references this issue on Jun 19, 2026
    1d8e911
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in triagePresently being triaged by the triage teamwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions