Skip to content

Commit

Permalink
fix crash
Browse files Browse the repository at this point in the history
fixes crash in sunlight widget (#735)
  • Loading branch information
forrestguice committed Aug 28, 2024
1 parent be97cad commit 447070f
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -777,9 +777,12 @@ protected void drawPoints(Canvas c, Paint p, LightGraphOptions options)
if (options.sunPath_show_points && (options.sunPath_show_line || options.sunPath_show_fill))
{
float[][] points = createPathPoints(c, options);
double pointSize = Math.sqrt(c.getWidth() * c.getHeight()) / options.sunPath_points_width;
for (float[] point : points) {
drawPoint(point[0], point[1], (int)pointSize, 0, c, p, options.colors.getColor(COLOR_POINT_FILL), options.colors.getColor(COLOR_POINT_STROKE), null);
if (points != null)
{
double pointSize = Math.sqrt(c.getWidth() * c.getHeight()) / options.sunPath_points_width;
for (float[] point : points) {
drawPoint(point[0], point[1], (int)pointSize, 0, c, p, options.colors.getColor(COLOR_POINT_FILL), options.colors.getColor(COLOR_POINT_STROKE), null);
}
}
}
}
Expand Down

0 comments on commit 447070f

Please sign in to comment.