All geometry equals methods now work with bad arguments (closes #1041).

git-svn-id: http://svn.openlayers.org/trunk/openlayers@4707 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2007-10-01 01:03:29 +00:00
parent 7ce4621042
commit a1d3f20632
2 changed files with 8 additions and 1 deletions

View File

@@ -288,7 +288,8 @@ OpenLayers.Geometry.Collection = OpenLayers.Class(OpenLayers.Geometry, {
*/
equals: function(geometry) {
var equivalent = true;
if(!geometry.CLASS_NAME || (this.CLASS_NAME != geometry.CLASS_NAME)) {
if(!geometry || !geometry.CLASS_NAME ||
(this.CLASS_NAME != geometry.CLASS_NAME)) {
equivalent = false;
} else if(!(geometry.components instanceof Array) ||
(geometry.components.length != this.components.length)) {