Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fa344d2 commit 42e075dCopy full SHA for 42e075d
1 file changed
csharp/extractor/Semmle.Extraction/PathTransformer.cs
@@ -44,7 +44,21 @@ private struct TransformedPath : ITransformedPath
44
45
public string Value => value;
46
47
- public string Extension => Path.GetExtension(value)?.Substring(1) ?? "";
+ public string Extension
48
+ {
49
+ get
50
51
+ var extension = Path.GetExtension(value);
52
+ if (string.IsNullOrEmpty(extension))
53
54
+ return "";
55
+ }
56
+ else
57
58
+ return extension.Substring(1);
59
60
61
62
63
public string NameWithoutExtension => Path.GetFileNameWithoutExtension(value);
64
0 commit comments