diff --git a/src/main/java/com/github/creme332/controller/canvas/drawing/DrawRegularPolygon.java b/src/main/java/com/github/creme332/controller/canvas/drawing/DrawRegularPolygon.java index 6c0a987..f27c053 100644 --- a/src/main/java/com/github/creme332/controller/canvas/drawing/DrawRegularPolygon.java +++ b/src/main/java/com/github/creme332/controller/canvas/drawing/DrawRegularPolygon.java @@ -104,11 +104,11 @@ private int inputVertices() { if (result == JOptionPane.OK_OPTION) { try { - int numSides = Integer.parseInt(numSidesField.getText()); - if (numSides < 3) { + int input = Integer.parseInt(numSidesField.getText()); + if (input < 3) { throw new NumberFormatException("Number of sides must be at least 3."); } - return numSides; + return input; } catch (NumberFormatException e) { JOptionPane.showMessageDialog(canvas, "Invalid input. Please enter an integer greater than or equal to 3 for the number of vertices.",