Don't crash when user agent is null/undefined