-
Notifications
You must be signed in to change notification settings - Fork 703
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MessageDialog on Android causes exception when user clicks outside dialog box #5114
Comments
Thank you for the report. The issue is that the returned value of the You'll need to ensure that you perform null checking on the return value. In order to catch those exceptions, you'll need to check the |
While I would never argue against checking for null or providing exception handling, please be aware that the Uno behavior is explicitly different from UWP. As evidence, please look at this example, provided by Microsoft: Notice that they do not check for null and directly dereference the return value. Further, the documentation gives no mention of a possible null return value. |
Indeed, the behavior is not the same, I'll keep the issue opened. In the meantime, you can validate for null as a workaround. |
Yes, I verified that checking for null is a workaround. |
I think fixing #1950 (being done in #6654) will also fix this issue. Can you confirm @jeromelaban ? |
@Youssef1313 it may, let's retry with the sample once merged. |
@vskotatko Can you try with the latest dev version? (currently |
@Youssef1313 Eventually, I can try, but it will be a while. Thanks for addressing this. |
Let's close this issue. You can reopen if it still happens. |
Current behavior
MessageDialog on Android causes exception when user clicks outside dialog box. On UWP, outside clicks are ignored.
Build and test this minimal app:
github.com/vskotato/MinMessage
Expected behavior
How to reproduce it (as minimally and precisely as possible)
Workaround
None.
Environment
Nuget Package:
Nuget Package Version(s):
Affected platform(s):
IDE:
Relevant plugins:
Anything else we need to know?
System.NullReferenceException
Message=Object reference not set to an instance of an object.
Stack Trace:
0xFFFFFFFFFFFFFFFF in System.Diagnostics.Debugger.Mono_UnhandledException_internal
0x1 in System.Diagnostics.Debugger.Mono_UnhandledException at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.Diagnostics/Debugger.cs:125,4
0x20 in Android.Runtime.DynamicMethodNameCounter.2
0x12 in System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:157,13
0x6 in System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.b__7_0 at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1021,49
0xC in Android.App.SyncContext. at /Users/builder/azdo/_work/278/s/xamarin-android/src/Mono.Android/Android.App/SyncContext.cs:36,19
0xE in Java.Lang.Thread.RunnableImplementor.Run at /Users/builder/azdo/_work/278/s/xamarin-android/src/Mono.Android/Java.Lang/Thread.cs:36,6
0x8 in Java.Lang.IRunnableInvoker.n_Run at /Users/builder/azdo/_work/278/s/xamarin-android/src/Mono.Android/obj/Release/monoandroid10/android-29/mcw/Java.Lang.IRunnable.cs:84,4
0x11 in Android.Runtime.DynamicMethodNameCounter.2
The text was updated successfully, but these errors were encountered: