summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorkitfox2012-01-08 09:15:40 +0100
committerkitfox2012-01-08 09:15:40 +0100
commitb2e50d3f683013eb702f9da1ac1e2715b1f3c8ed (patch)
treeffbf26a20a95b286666b3c691190a03637582731 /src
parentRoots now automatically assigned a diagram when attached to SVGDiagram. (diff)
downloadsvg-salamander-core-b2e50d3f683013eb702f9da1ac1e2715b1f3c8ed.tar.gz
svg-salamander-core-b2e50d3f683013eb702f9da1ac1e2715b1f3c8ed.tar.xz
svg-salamander-core-b2e50d3f683013eb702f9da1ac1e2715b1f3c8ed.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/kitfox/svg/animation/TrackManager.java8
1 files changed, 7 insertions, 1 deletions
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;