From b2e50d3f683013eb702f9da1ac1e2715b1f3c8ed Mon Sep 17 00:00:00 2001 From: kitfox Date: Sun, 8 Jan 2012 08:15:40 +0000 Subject: Fixes NPE when adding a track without a name. git-svn-id: https://svn.java.net/svn/svgsalamander~svn/trunk/svg-core@104 7dc7fa77-23fb-e6ad-8e2e-c86bd48ed22b --- src/main/java/com/kitfox/svg/animation/TrackManager.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/kitfox/svg/animation/TrackManager.java b/src/main/java/com/kitfox/svg/animation/TrackManager.java index b8e6305..0e9daa0 100644 --- a/src/main/java/com/kitfox/svg/animation/TrackManager.java +++ b/src/main/java/com/kitfox/svg/animation/TrackManager.java @@ -59,7 +59,13 @@ public class TrackManager implements Serializable this.type = type; } - public int hashCode() { return name.hashCode() ^ type; } + public int hashCode() + { + int hash = name == null ? 0 : name.hashCode(); + hash = hash * 97 + type; + return hash; + } + public boolean equals(Object obj) { if (!(obj instanceof TrackKey)) return false; -- cgit v1.2.3-55-g7522