`ScreenEvents.afterRender`'s screen null check fails when opening the disconnect screen
See original GitHub issueRunning the following in my screen’s render method results in the null check failing, and crashing the game.
client.getInstance().world.disconnect();
client.getInstance().disconnect(new SaveLevelScreen(new TranslatableText("menu.savingLevel")));
My screen’s code and the code that calls it Crash Log
Though, if I strip everything and just have the code in the code block in the render, and nothing else, it still crashes. If I run the code instead of opening the screen, it doesn’t crash.
The code in the quit method is practically identical to the code in the vanilla’s exit to main menu button
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (11 by maintainers)
Top Results From Across the Web
firebase - _CastError (Null check operator used on a null ...
So I am creating an Instagram clone and when I open the feed screen, an error that says '_CastError (Null check operator used...
Read more >Automatic Output Handling and Null Checking - UnofficialSF
Instead, the Flow team recommends using Automatic Output Handling and checking whether the object itself is null instead of checking its fields.
Read more >Getting errors with null fields - Power Automate | Microsoft Learn
Provides a solution to an error that occurs when you create a flow in Microsoft Power Automate.
Read more >Understanding Null-Safety in Flutter with Real-world example
First create a screen to show the data. Let's create a class HomeScreen which can look like class HomeScreen extends StatefulWidget { const ......
Read more >Non-Nullable Dart: Understanding Null Safety - Kodeco
null helps developers deal with the unknown in their code. When any exception is not handled, the app will show a red error...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Like use an atomic boolean that is set to true in render method when the screen needs to quit. In tick method you detect if the boolean is true and quit accordingly if it is.
The check should never occur except in cases of race condition in 1.17+.