Commits

Daniel Nadeau committed 12ca106 Merge

Merged in cntwo/holographlibrary (pull request #13)

Added guard statements to getMaxX and getMinX

  • Participants
  • Parent commits 05f7a45, a6ebf4b

Comments (0)

Files changed (1)

File HoloGraphLibrary/src/com/echo/holographlibrary/LineGraph.java

 		return maxY;
 	}
 	public float getMaxX(){
-		float max = lines.get(0).getPoint(0).getX();
+		float max = lines.size() > 0 ? lines.get(0).getPoint(0).getX() : 0;
 		for (Line line : lines){
 			for (LinePoint point : line.getPoints()){
 				max = point.getX() > max ? point.getX() : max;
 		
 	}
 	public float getMinX(){
-		float min = lines.get(0).getPoint(0).getX();
+		float min = lines.size() > 0 ? lines.get(0).getPoint(0).getX() : 0;
 		for (Line line : lines){
 			for (LinePoint point : line.getPoints()){
 				min = point.getX() < min ? point.getX() : min;