Don't NPE when we have a missing color class in the list, instead, return -1 to emulate the old IntIntMap behavior.
git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@926 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -53,7 +53,10 @@ public class StageSceneModel extends SceneModel
|
|||||||
public int getDefaultColor (int classId)
|
public int getDefaultColor (int classId)
|
||||||
{
|
{
|
||||||
if (defaultColors != null) {
|
if (defaultColors != null) {
|
||||||
return defaultColors.get(classId);
|
Integer result = defaultColors.get(classId);
|
||||||
|
if (result != null) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user