mono/mono-addins

Exception on list-update and update

diva opened this issue · 3 comments

diva commented

mautil always crashes when looking for updates:
$ ../../mono-addins/mono-addins/bin/mautil.exe -p . -reg F:/dev/registry list-update
Looking for updates...
Available add-in updates:
System.NullReferenceException: Object reference not set to an instance of an object.
at Mono.Addins.Setup.SetupTool.IsHidden(Addin ainfo) in F:\dev\mono-addins\mono-addins\Mono.Addins.Setup\Mono.Addins.Setup\SetupTool.cs:line 291
at Mono.Addins.Setup.SetupTool.ListUpdates(String[] args) in F:\dev\mono-addins\mono-addins\Mono.Addins.Setup\Mono.Addins.Setup\SetupTool.cs:line 357
at Mono.Addins.Setup.SetupTool.Run(String[] args) in F:\dev\mono-addins\mono-addins\Mono.Addins.Setup\Mono.Addins.Setup\SetupTool.cs:line 149
at mautil.MainClass.Main(String[] args) in F:\dev\mono-addins\mono-addins\mautil\Main.cs:line 110

I think I know why. In both SetupTool.cs ListUpdates(...) and SetupTool.cs Update(...) you have:
Addin sinfo = registry.GetAddin (addin.Addin.Id);

But addin.Addin.Id returns the full Id with the version number, so things like MyAddin,0.8.1.0.1

I believe you need to search for LocalId instead, so
Addin sinfo = registry.GetAddin (addin.Addin.LocalId);

I tried it and it fixed the issue. Since it's so simple to fix, I'm not sending up a pull request.

I kinda hope this doesn't get fixed... You forget about it... And in few months you update from upstream and forget this patch... Karma is bitch...

diva commented

Too early in the year to even acknowledge the existence of sarcasm, I'm afraid... :-)
Try again, if this issue affects you too.

Internet is full of ******** people... It's hard to detect sarcasm really... Nice to see you are not one of them ;)