Improper Neutralization

I am getting the following error in veracode for my code snippet.

Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)

The code is

if(!string.IsNullOrEmpty(fileName))
            {
                string pattern = @"^[0-9A-Z]([-.\w]*[0-9A-Z])*$";
                Match m = Regex.Match(fileName, pattern, RegexOptions.IgnoreCase);
                if (m.Success)
                **{**                        
                    if (System.IO.File.Exists(m.Value))
                    {
                        return  m.Value;
                    }
                    else
                    {
                        return "";
                    }
                }
                else
                {
                    return "";
                }
            }

I am getting the error at the star marked bracket

.NET Foundation Website | Blog | Projects | Code of Conduct