Skip to content

Commit e55b2e5

Browse files
committed
Add validation to public methods
1 parent f76e977 commit e55b2e5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/GitVersionCore/TemplateManager.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ public TemplateManager(TemplateType templateType)
2525

2626
public string GetTemplateFor(string fileExtension)
2727
{
28+
if (fileExtension == null)
29+
{
30+
throw new ArgumentNullException(nameof(fileExtension));
31+
}
32+
2833
string result = null;
2934
string template;
3035

@@ -38,6 +43,11 @@ public string GetTemplateFor(string fileExtension)
3843

3944
public string GetAddFormatFor(string fileExtension)
4045
{
46+
if (fileExtension == null)
47+
{
48+
throw new ArgumentNullException(nameof(fileExtension));
49+
}
50+
4151
string result = null;
4252
string addFormat;
4353

0 commit comments

Comments
 (0)