manuelbieh / geolib

Zero dependency library to provide some basic geo functions
MIT License
4.23k stars 341 forks source link

TypeError: Cannot read property 'hasOwnProperty' of null #67

Open gregmazur opened 8 years ago

gregmazur commented 8 years ago

When using with AngularJS shows a NullPointerException at 116 geolib.js

                // TODO: check if point is an object
                if(typeof point != 'object' ) {

changed to " if(typeof point != 'object' || point == null) {" and it works just fine

ptz0n commented 8 years ago

You could filter out the objects with missing lat/lng from the array/object beforehand.