icsharpcode / AvaloniaILSpy

Avalonia-based .NET Decompiler (port of ILSpy)
1.5k stars 169 forks source link

Save Code context menu option does not save the solution if a filename is selected #101

Closed GatoCreador887 closed 2 years ago

GatoCreador887 commented 2 years ago

The "Save Code" context menu option does not actually save any code. This is caused by: https://github.com/icsharpcode/AvaloniaILSpy/blob/4147e8ca160b35ce4a70382891ff5f08caaa8856/ILSpy.Core/Commands/SaveCodeContextMenuEntry.cs#L106-L110 Thus, if the user selects a filename to save the solution under, this code simply returns null, as if the user had cancelled the saving. If the user does indeed cancel the saving, this goes on to attempt what it should be doing when the user selects a filename. Thus, I suggest this check be changed to filename == null rather than filename != null.