Bug 330505

Summary: NullRef Exception in svn log tab
Product: [Mono] MonoDevelop Reporter: Ian Walker <walker_643>
Component: generalAssignee: Zach Lute <zach.lute>
Status: RESOLVED FIXED QA Contact: MD Bugs <monodevelop-bugs>
Severity: Normal    
Priority: P5 - None CC: zach.lute
Version: SVN   
Target Milestone: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Patch to check FileSystemWatchers before disposing them.

Description Ian Walker 2007-10-03 18:07:32 UTC
The exception below is generated by opening the svn 'log' tab (For me, that's right-click on a file in Solution Pane, Version Control, Log), then select a revision line, click 'View Changes', and then close the 'Changes' tab.  I immediately got the exception at this point. For me, this problem is highly reproducible; it happens every time.



Exception occurred: Object reference not set to an instance of an object

System.NullReferenceException: Object reference not set to an instance of an object
  at MonoDevelop.VersionControl.Views.DiffView.Dispose () [0x00000] in /usr/src/sharp/monodevelop-svn/Extras/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/Diffs.cs:79 
  at MonoDevelop.Ide.Gui.SdiWorkspaceWindow.CloseWindow (Boolean force, Boolean fromMenu, Int32 pageNum) [0x00152] in /usr/src/sharp/monodevelop-svn/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs:250 
  at MonoDevelop.Ide.Gui.SdiWorkbenchLayout.closeClicked (System.Object o, System.EventArgs e) [0x00043] in /usr/src/sharp/monodevelop-svn/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceLayout.cs:718 
  at MonoDevelop.Components.TabLabel.ButtonClicked (System.Object o, System.EventArgs eventArgs) [0x0000b] in /usr/src/sharp/monodevelop-svn/Core/src/MonoDevelop.Components/MonoDevelop.Components/TabLabel.cs:92
Comment 1 Zach Lute 2007-10-04 01:25:59 UTC
The FileSystemWatchers were being Disposed even if they weren't created (when a DiffView was created through arrays of strings instead of loading files).  This patch adds checks to only dispose them if they actually exist.
Comment 2 Zach Lute 2007-10-04 01:26:50 UTC
Created attachment 176250 [details]
Patch to check FileSystemWatchers before disposing them.
Comment 3 Lluis Sanchez 2007-10-04 10:12:36 UTC
Patch committed. Thanks!