I keep getting Exception in template helper: TypeError: Cannot read property 'coords' of null when first calling geolocation


#1
        var fromLat = Geolocation.currentLocation().coords.latitude;
        var fromLng = Geolocation.currentLocation().coords.longitude;

debug.js:41 Exception in template helper: TypeError: Cannot read property 'coords' of null
    at Object.Template.home.helpers.images (http://127.0.0.1:3000/app/client/templates/home/home.js?3e020770d01e841360fd1115d63b6042e3dfdf68:25:48)

But, it is only once when the page loads. after that it seems okay. any help would be cool


#2

well, it is regarding this line Geolocation.currentLocation().coords.latitude

and yes, Geolocation.currentLocation() can be null before proper initialization


#4

well, Geolocation object is not part of the core, so maybe consult readme to given package