Skip to content

Commit a457fbc

Browse files
committed
Don't throw needless exceptions on empty filenames
If we are passed `string.Empty` we should just return an empty readonly list instead of throwing an exception and then returning an empty readonly list. This makes it easier to debug XS using a catchpoint on System.Exception
1 parent d60142e commit a457fbc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Mono.Debugging/Mono.Debugging.Client/BreakpointStore.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,9 @@ public ReadOnlyCollection<Breakpoint> GetBreakpointsAtFile (string filename)
280280
throw new ArgumentNullException ("filename");
281281

282282
var list = new List<Breakpoint> ();
283-
283+
if (string.IsNullOrEmpty (filename))
284+
return list.AsReadOnly ();
285+
284286
try {
285287
filename = Path.GetFullPath (filename);
286288
} catch {

0 commit comments

Comments
 (0)