Avoid NPE.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1742 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -26,7 +26,7 @@ public class DataTool
|
|||||||
*/
|
*/
|
||||||
public Object get (Object array, int index)
|
public Object get (Object array, int index)
|
||||||
{
|
{
|
||||||
return Array.get(array, index);
|
return (array == null) ? null : Array.get(array, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -34,7 +34,7 @@ public class DataTool
|
|||||||
*/
|
*/
|
||||||
public int length (Object array)
|
public int length (Object array)
|
||||||
{
|
{
|
||||||
return Array.getLength(array);
|
return (array == null) ? 0 : Array.getLength(array);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user