Skip to content

Null check operator used on a null value #178619

Description

@mrcsh

Steps to reproduce

It is unclear where (in our code) this is comming from, I think it's usually only on the web version of our app.

The error is being logged by the Uncaught Error handler. it's been happening since 3.35 I belive.

Null check operator used on a null value↵
TypeError: Cannot read properties of null (reading 'focus')↵
    at GloballyPositionedTextEditingStrategy.placeElement$0 (https://aio.lochbox.app/vL8CUKhWmHM9gmT64gRAdQ.js.gz:226791:26)↵
    at GloballyPositionedTextEditingStrategy.updateElementPlacement$1 (https://aio.lochbox.app/vL8CUKhWmHM9gmT64gRAdQ.js.gz:226979:17)↵
    at TextInputSetEditableSizeAndTransform.run$1 (https://aio.lochbox.app/vL8CUKhWmHM9gmT64gRAdQ.js.gz:227503:34)↵
    at TextEditingChannel.handleTextInput$2 (https://aio.lochbox.app/vL8CUKhWmHM9gmT64gRAdQ.js.gz:227617:15)↵
    at EnginePlatformDispatcher._sendPlatformMessage$3 (https://aio.lochbox.app/vL8CUKhWmHM9gmT64gRAdQ.js.gz:219777:47)↵
    at _DefaultBinaryMessenger.send$2 (https://aio.lochbox.app/vL8CUKhWmHM9gmT64gRAdQ.js.gz:595508:51)↵
    at https://aio.lochbox.app/vL8CUKhWmHM9gmT64gRAdQ.js.gz:596756:54↵
    at _wrapJsFunctionForAsync_closure.$protected (https://aio.lochbox.app/vL8CUKhWmHM9gmT64gRAdQ.js.gz:12123:15)↵
    at _wrapJsFunctionForAsync_closure.call$2 (https://aio.lochbox.app/vL8CUKhWmHM9gmT64gRAdQ.js.gz:237656:12)↵
    at Object._asyncStartSync (https://aio.lochbox.app/vL8CUKhWmHM9gmT64gRAdQ.js.gz:12087:20)

Expected results

Code should not be using the ! operator with out checking...

Actual results

These null check errors are randomly showing up in our application logs.

Code sample

Since I don't know where this is even coming from I can't provide a stripped down example.
But hopefully given the relatively readable stack track you can tell where the unchecked .focus! is.
I have not seen any strange behaviour in our app nor do I even know how to make this error happen within our app. I just see the error in our logs.

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
Null check operator used on a null value↵
TypeError: Cannot read properties of null (reading 'focus')↵
    at GloballyPositionedTextEditingStrategy.placeElement$0 (https://aio.lochbox.app/vL8CUKhWmHM9gmT64gRAdQ.js.gz:226791:26)↵
    at GloballyPositionedTextEditingStrategy.updateElementPlacement$1 (https://aio.lochbox.app/vL8CUKhWmHM9gmT64gRAdQ.js.gz:226979:17)↵
    at TextInputSetEditableSizeAndTransform.run$1 (https://aio.lochbox.app/vL8CUKhWmHM9gmT64gRAdQ.js.gz:227503:34)↵
    at TextEditingChannel.handleTextInput$2 (https://aio.lochbox.app/vL8CUKhWmHM9gmT64gRAdQ.js.gz:227617:15)↵
    at EnginePlatformDispatcher._sendPlatformMessage$3 (https://aio.lochbox.app/vL8CUKhWmHM9gmT64gRAdQ.js.gz:219777:47)↵
    at _DefaultBinaryMessenger.send$2 (https://aio.lochbox.app/vL8CUKhWmHM9gmT64gRAdQ.js.gz:595508:51)↵
    at https://aio.lochbox.app/vL8CUKhWmHM9gmT64gRAdQ.js.gz:596756:54↵
    at _wrapJsFunctionForAsync_closure.$protected (https://aio.lochbox.app/vL8CUKhWmHM9gmT64gRAdQ.js.gz:12123:15)↵
    at _wrapJsFunctionForAsync_closure.call$2 (https://aio.lochbox.app/vL8CUKhWmHM9gmT64gRAdQ.js.gz:237656:12)↵
    at Object._asyncStartSync (https://aio.lochbox.app/vL8CUKhWmHM9gmT64gRAdQ.js.gz:12087:20)

Flutter Doctor output

Doctor output
flutter doctor 
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.38.1, on Fedora Linux 42 (Adams) 6.16.12-200.fc42.x86_64, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Connected device (6 available)
[✓] Network resources

• No issues found!

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: productionIssues experienced in live production appsa: text inputEntering text in a text field or keyboard related problemsc: crashStack traces logged to the consoleneeds repro infoAutomated crash report whose cause isn't yet knownr: fixedIssue is closed as already fixed in a newer versionteam-webOwned by Web platform teamtriaged-webTriaged by Web platform team

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions