Close

Profile: oumiller21

Avatar

User posts

Bugs
10 years ago

In the razor file called _Root.Head.cshtml there is an if statement that checks to see if the UserAgent  contains the text "Android 2.3"

if (Request.UserAgent.IndexOf("Android 2.3", StringComparison.InvariantCultureIgnoreCase) > 0)
{
        isAndroid23Class = "android23";
}

However, the UserAgent could be null and an exception will be thrown. The code should be written like this

if (Request.UserAgent != null &&
        Request.UserAgent.IndexOf("Android 2.3", StringComparison.InvariantCultureIgnoreCase) > 0)
    {
        isAndroid23Class = "android23";
    }