mirror of
https://github.com/apache/commons-math.git
synced 2025-03-04 15:39:17 +00:00
Do sanity checks first to prevent NullPointerException.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1499076 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9d5ce00453
commit
9fb08c2f9e
@ -677,13 +677,15 @@ public class MathArrays {
|
||||
double[] ... yList)
|
||||
throws NullArgumentException,
|
||||
DimensionMismatchException {
|
||||
final int yListLen = yList.length;
|
||||
final int len = x.length;
|
||||
|
||||
// Consistency checks.
|
||||
if (x == null) {
|
||||
throw new NullArgumentException();
|
||||
}
|
||||
|
||||
final int yListLen = yList.length;
|
||||
final int len = x.length;
|
||||
|
||||
for (int j = 0; j < yListLen; j++) {
|
||||
final double[] y = yList[j];
|
||||
if (y == null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user