Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

NullReferenceException when closing dirty xml or text file and not saving. #358

@mrward

Description

@mrward

To reproduce

Reported on the forum - http://community.sharpdevelop.net/forums/t/20377.aspx

  1. Create an empty C# project.
  2. Add a new xml or text file to the project.
  3. Make a change to the file so it is dirty.
  4. Close the file using the x at the top right of the text editor.
  5. When prompted choose not to save file.

Expected result

File is closed and changes are lost.

Actual result

System.NullReferenceException: Object reference not set to an instance of an object.
   at ICSharpCode.SharpDevelop.Parser.ParserServiceEntry.DoParseAsync(ITextSource fileContent, IProject parentProject, Boolean requestFullParseInformation, CancellationToken cancellationToken) in src\Main\SharpDevelop\Parser\ParserServiceEntry.cs:line 322
   at ICSharpCode.SharpDevelop.Parser.ParserServiceEntry.<ParseAsync>d__7.MoveNext() in src\Main\SharpDevelop\Parser\ParserServiceEntry.cs:line 295
21:00:45.803 [5] WARN - Stack trace of last exception log:
   at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
   at System.Environment.get_StackTrace()
   at ICSharpCode.SharpDevelop.Logging.SDMessageService.ShowException(Exception ex, String message) in src\Main\SharpDevelop\Logging\SDMessageService.cs:line 29
   at ICSharpCode.Core.MessageService.ShowException(Exception ex, String message) in src\Main\Core\Project\Src\Services\MessageService\MessageService.cs:line 59
   at ICSharpCode.SharpDevelop.SharpDevelopExtensions.<FireAndForget>b__0(Task t) in src\Main\Base\Project\Util\SharpDevelopExtensions.cs:line 101
   at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
   at System.Threading.Tasks.Task.ExecutionContextCallback(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
   at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
   at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions