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

[BUG] ObservableAsPropertyHelper.Value throws ArgumentNullException #2455

Closed
jcummings2 opened this issue Jul 24, 2020 · 2 comments
Closed
Labels

Comments

@jcummings2
Copy link
Contributor

Describe the bug
ObservableAsPropertyHelper.Value throws an ArgumentNullException if the subscription was deferred and the object has been disposed (perhaps on another thread). This behavior is unexpected and confusing as to the real source of the problem - namely that the OAPH has been disposed.

Steps To Reproduce

  1. Create an OAPH
  2. Dispose the OAPH
  3. Access Value property of the OAPH
  4. Throws ArgumentNullException

See also the unit test in the Pull Request.

Expected behavior

Either:

  1. No error thrown and the last value is maintained
  2. Throw ObjectDisposedException

Not throwing any exception is preferred to ease multi-threading access by reducing the need for thread synchronization.

Screenshots
N/A

Environment

  • OS: Windows
  • Version 11.4.17
  • Device: PC

Additional context
N/A

@jcummings2 jcummings2 added the bug label Jul 24, 2020
@open-collective-bot
Copy link

open-collective-bot bot commented Jul 24, 2020

Hey @jcummings2 👋,

Thank you for opening an issue. We will get back to you as soon as we can. Also, check out our Open Collective and consider contributing financially.

https://opencollective.com/reactiveui

PS.: We offer priority support for all financial contributors. Don't forget to add priority label once you start contributing 😄

An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms!

glennawatson pushed a commit that referenced this issue Jul 24, 2020
 (#2456)

* fix: avoid throwing ArgumentNullException from OAPH.Value (#2455)

Ensure OAPH CompositeDisposable is not null before subscribing
Add unit test to cover case where OAPH has been disposed

* docs: remove duplicate words in OAPH documentation

Co-authored-by: John Cummings <john.cummings@quantitech.com>
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant