Don't choke if _elements is null.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@1148 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
mdb
2003-06-16 18:11:30 +00:00
parent 1510c9cd09
commit 29da1d07fa
@@ -1,5 +1,5 @@
//
// $Id: SortableArrayList.java,v 1.13 2003/04/30 22:24:31 ray Exp $
// $Id: SortableArrayList.java,v 1.14 2003/06/16 18:11:30 mdb Exp $
//
// samskivert library - useful routines for java programs
// Copyright (C) 2001 Michael Bayne
@@ -249,8 +249,11 @@ public class SortableArrayList extends AbstractList
public Object clone ()
{
try {
Object[] elDup = new Object[_elements.length];
System.arraycopy(_elements, 0, elDup, 0, _elements.length);
Object[] elDup = null;
if (_elements != null) {
elDup = new Object[_elements.length];
System.arraycopy(_elements, 0, elDup, 0, _elements.length);
}
SortableArrayList dup = (SortableArrayList) super.clone();
dup._elements = elDup;