Browse Source

Fix ArgumentNullException due to null filename when stepping in debugger.

pull/403/head
Daniel Grunwald 12 years ago
parent
commit
cf8f7e890a
  1. 2
      src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs
  2. 4
      src/Main/SharpDevelop/Workbench/DisplayBinding/DisplayBindingService.cs
  3. 2
      src/Main/SharpDevelop/Workbench/FileService.cs

2
src/AddIns/Debugger/Debugger.AddIn/Service/WindowsDebugger.cs

@ -661,6 +661,8 @@ namespace ICSharpCode.SharpDevelop.Services @@ -661,6 +661,8 @@ namespace ICSharpCode.SharpDevelop.Services
public override void JumpToCurrentLine(string sourceFullFilename, int startLine, int startColumn, int endLine, int endColumn)
{
if (string.IsNullOrEmpty(sourceFullFilename))
return;
IViewContent viewContent = FileService.OpenFile(sourceFullFilename);
if (viewContent != null) {
IPositionable positionable = viewContent.GetService<IPositionable>();

4
src/Main/SharpDevelop/Workbench/DisplayBinding/DisplayBindingService.cs

@ -99,6 +99,8 @@ namespace ICSharpCode.SharpDevelop.Workbench @@ -99,6 +99,8 @@ namespace ICSharpCode.SharpDevelop.Workbench
public IDisplayBinding GetBindingPerFileName(FileName filename)
{
SD.MainThread.VerifyAccess();
if (filename == null)
return null;
if (FileUtility.IsUrl(filename)) {
// The normal display binding dispatching code can't handle URLs (e.g. because it uses Path.GetExtension),
// so we'll directly return the browser display binding.
@ -115,6 +117,8 @@ namespace ICSharpCode.SharpDevelop.Workbench @@ -115,6 +117,8 @@ namespace ICSharpCode.SharpDevelop.Workbench
{
SD.MainThread.VerifyAccess();
if (filename == null)
return null;
string defaultCommandID = displayBindingServiceProperties.Get("Default" + Path.GetExtension(filename).ToLowerInvariant(), string.Empty);
if (!string.IsNullOrEmpty(defaultCommandID)) {
foreach (DisplayBindingDescriptor binding in bindings) {

2
src/Main/SharpDevelop/Workbench/FileService.cs

@ -304,6 +304,8 @@ namespace ICSharpCode.SharpDevelop.Workbench @@ -304,6 +304,8 @@ namespace ICSharpCode.SharpDevelop.Workbench
/// <inheritdoc/>
public IViewContent OpenFile(FileName fileName, bool switchToOpenedView)
{
if (fileName == null)
throw new ArgumentNullException("fileName");
LoggingService.Info("Open file " + fileName);
IViewContent viewContent = GetOpenFile(fileName);

Loading…
Cancel
Save