Bug 688158 - Make navigator.geolocation return null if geolocation is disabled. r=jst

This commit is contained in:
Josh Matthews 2011-09-21 11:07:41 -04:00
parent c5e7c1fde8
commit e2cd980b50

View File

@ -11321,6 +11321,9 @@ NS_IMETHODIMP nsNavigator::GetGeolocation(nsIDOMGeoGeolocation **_retval)
NS_ENSURE_ARG_POINTER(_retval);
*_retval = nsnull;
if (!Preferences::GetBool("geo.enabled", PR_TRUE))
return NS_OK;
if (mGeolocation) {
NS_ADDREF(*_retval = mGeolocation);
return NS_OK;