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

uninstall - Object reference exception when there are no sources #1584

Closed
jirkapok opened this issue May 30, 2018 · 2 comments
Closed

uninstall - Object reference exception when there are no sources #1584

jirkapok opened this issue May 30, 2018 · 2 comments

Comments

@jirkapok
Copy link
Contributor

jirkapok commented May 30, 2018

Steps to reproduce on 0.10.11:

  • configure default chocolatey source if not present
  • install git package (package is not relevant, applies to any package)
  • remove all package sources
  • call choco uninstall git -y

Actual result:
Following error message is returned: Object reference not set to an instance of an object.

Expected result:
No message is shown and package is successfully uninstalled, since you dont need package sources for uninstall.

Note:

  • The same issue applies also for other commands (but i didnt note which one was the second).
  • Exception is thrown from NugetCommon.GetRemoteRepository line 80, where split method fails null sources property.
@ferventcoder
Copy link
Member

I think there was an age old issue this is related to. We didn't find it because we didn't know what it was related to. This is helpful.

ferventcoder pushed a commit that referenced this issue Jan 18, 2019
When source are null, it causas a null reference exception in NuGetCommon
due to the split of a null value. Instead, convert to string safely prior
to splitting the values. Add tests to verify this behavior.
ferventcoder added a commit that referenced this issue Jan 18, 2019
* pr1587:
  (GH-1584) Fix Exception when source is null
ferventcoder added a commit that referenced this issue Jan 18, 2019
* stable:
  (GH-1584) Fix Exception when source is null
  (GH-1704) Upgrade 7z to 18.6
@ferventcoder
Copy link
Member

Thanks for your contribution! This has been merged and will be released in 0.10.12.

@ferventcoder ferventcoder changed the title Object reference exception when there are no sources uninstall - Object reference exception when there are no sources Mar 7, 2019
@ferventcoder ferventcoder self-assigned this Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants