Allow colors to be compare to null.

This commit is contained in:
Jürg Lehni 2011-05-05 11:20:26 +01:00
parent a59fab0409
commit 5dfec35dc1

View file

@ -161,7 +161,7 @@ var Color = this.Color = Base.extend(new function() {
* @return {@true if the GrayColor is the same}
*/
equals: function(color) {
if (color._colorType == this._colorType) {
if (color && color._colorType == this._colorType) {
for (var i = 0, l = this._components; i < l; i++) {
var component = '_' + this._components[i];
if (this[component] !== color[component])