Log a warning and return null.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2862 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: ColorPository.java,v 1.4 2003/06/23 18:06:57 mdb Exp $
|
||||
// $Id: ColorPository.java,v 1.5 2003/11/22 19:57:16 mdb Exp $
|
||||
|
||||
package com.threerings.media.image;
|
||||
|
||||
@@ -83,6 +83,13 @@ public class ColorPository implements Serializable
|
||||
list.toArray(new ColorRecord[list.size()]);
|
||||
}
|
||||
|
||||
// sanity check
|
||||
if (_starters.length < 1) {
|
||||
Log.warning("Requested random starting color from " +
|
||||
"colorless component class " + this + "].");
|
||||
return null;
|
||||
}
|
||||
|
||||
// return a random entry from the array
|
||||
return _starters[RandomUtil.getInt(_starters.length)];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user