Skip to content

Commit fb605c2

Browse files
committed
Only include XML comments if assembly has a location
1 parent b91be1e commit fb605c2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Source/Boxed.AspNetCore.Swagger/SwaggerGenOptionsExtensions.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ public static SwaggerGenOptions IncludeXmlCommentsIfExists(this SwaggerGenOption
3131
throw new ArgumentNullException(nameof(assembly));
3232
}
3333

34-
var filePath = Path.ChangeExtension(assembly.Location, ".xml");
35-
IncludeXmlCommentsIfExists(options, filePath);
34+
if (!string.IsNullOrEmpty(assembly.Location))
35+
{
36+
var filePath = Path.ChangeExtension(assembly.Location, ".xml");
37+
IncludeXmlCommentsIfExists(options, filePath);
38+
}
3639

3740
return options;
3841
}

0 commit comments

Comments
 (0)