Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Commit

Permalink
Fix java.lang.NullPointerException: Attempt to get length of null array
Browse files Browse the repository at this point in the history
Signed-off-by: micrusa <[email protected]>
  • Loading branch information
micrusa committed Apr 27, 2020
1 parent ada791b commit f2f19d7
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
public class latestTraining {
private defValues defValues = new defValues();

private int[] hrArray = new int[0];
private int[] hrArray = null;

public void addHrValue(int value){
if(this.hrArray == null){
this.hrArray = new int[0];
}
int[] newArray = new int[this.hrArray.length + 1];
for(int i=0; i<this.hrArray.length; i++){
newArray[i] = this.hrArray[i];
Expand Down

0 comments on commit f2f19d7

Please sign in to comment.