Avoid sticking a fork in things if we are asked to remove a null key.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4268 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2006-07-18 01:08:31 +00:00
parent 7ad341ef8d
commit 5def25058a
@@ -324,6 +324,13 @@ public class DSet<E extends DSet.Entry>
*/
protected E removeKey (Comparable key)
{
// don't fail, but generate a warning if we're passed a null key
if (key == null) {
Log.warning("Requested to remove null key.");
Thread.dumpStack();
return null;
}
// look up this entry's position in our set
int eidx = ArrayUtil.binarySearch(
_entries, 0, _size, key, ENTRY_COMP);