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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullRef exception when window has never been maximized #14

Closed
BrainCrumbz opened this issue Jul 14, 2016 · 5 comments
Closed

NullRef exception when window has never been maximized #14

BrainCrumbz opened this issue Jul 14, 2016 · 5 comments

Comments

@BrainCrumbz
Copy link
Contributor

This is close to issue #13 . In that case, the "main content window" had been maximized and then minimized at least once previously, before actually trying to show a toast.

In this case instead, main content windows has never been maximized since application start. When program logic decides a toast should be generated, another (different) NullReferenceException is thrown. Again, the toast seems to be created because Windows 10 shows its system notification with toast message. The exception is actually thrown a couple of seconds right after that.

From a debug version of DLL, we got this is the offending line, nr 94 in NotificationsSource.cs:

n.InvokeHideAnimation();

where InvokeHideAnimation Action field is null.

rafallopatka pushed a commit that referenced this issue Jul 17, 2016
@rafallopatka
Copy link
Owner

Hi, same situation as with #13, I couldn't reproduce error, so I made a null checks in NotificationSource in line 94 as you suggested. Fix is avalaible in 1.4.1 if it's not working for you please provide sample code to reproduce this error.

@BrainCrumbz
Copy link
Contributor Author

I'll let you know as soon as we update and try again. Tnx!

@BrainCrumbz
Copy link
Contributor Author

Just a note on commit addressing these issues, the current one in particular:

At this line:

n.InvokeHideAnimation();

the exception is not due to n being null, but due to its Action field InvokeHideAnimation being null.

So newly added check:

if (n == null)
    return;

should not help. I guess it should be something like:

if (n.InvokeHideAnimation == null)
    return;

@rafallopatka
Copy link
Owner

Hi thanks I will fix this in 1.4.3

rafallopatka pushed a commit that referenced this issue Jul 19, 2016
@BrainCrumbz
Copy link
Contributor Author

Confirm: 1.4.3 fixes this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants