Skip to content
This repository has been archived by the owner on Oct 11, 2019. It is now read-only.

Commit

Permalink
Fix 290.rec editor crashing program when entered number is invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo40Git committed Dec 15, 2017
1 parent 74dc569 commit 2b95708
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
3.0
3.0.1
Hotfix 3.0.1:
- Fix 290.rec editor crashing program when entered number is invalid
Version 3.0 - The Plus Update:
- Added Cave Story+ support!
- Many other fixes and changes that I can't remember
2 changes: 1 addition & 1 deletion src/main/java/com/leo/cse/frontend/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class Main extends JFrame implements ExeLoadListener, ProfileListener {
private static final long serialVersionUID = -5073541927297432013L;

public static final Dimension WINDOW_SIZE = new Dimension(867, 686);
public static final Version VERSION = new Version("3.0");
public static final Version VERSION = new Version("3.0.1");
public static final String UPDATE_CHECK_SITE = "https://raw.githubusercontent.com/Leo40Git/CaveSaveEdit/master/.version";
public static final String DOWNLOAD_SITE = "https://github.com/Leo40Git/CaveSaveEdit/releases/";
public static final Color COLOR_BG = new Color(0, 0, 25);
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/com/leo/cse/frontend/ui/components/NikuEdit.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ public void onClick(int x, int y, boolean shiftDown, boolean ctrlDown) {
Integer.toUnsignedString(NikuRecord.getMinutes()));
if (nVal == null)
return;
int min = Integer.parseUnsignedInt(nVal);
if (min > 99)
min = 99;
try {
int min = Integer.parseUnsignedInt(nVal);
if (min > 99)
min = 99;
NikuRecord.setMinutes(min);
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(Main.window, "Input \"" + nVal + "\" was not a valid number!",
Expand All @@ -100,10 +100,10 @@ public void onClick(int x, int y, boolean shiftDown, boolean ctrlDown) {
Integer.toUnsignedString(NikuRecord.getSeconds()));
if (nVal == null)
return;
int sec = Integer.parseUnsignedInt(nVal);
if (sec > 59)
sec = 59;
try {
int sec = Integer.parseUnsignedInt(nVal);
if (sec > 59)
sec = 59;
NikuRecord.setSeconds(sec);
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(Main.window, "Input \"" + nVal + "\" was not a valid number!",
Expand All @@ -115,10 +115,10 @@ public void onClick(int x, int y, boolean shiftDown, boolean ctrlDown) {
Integer.toUnsignedString(NikuRecord.getTenths()));
if (nVal == null)
return;
int ten = Integer.parseUnsignedInt(nVal);
if (ten > 9)
ten = 9;
try {
int ten = Integer.parseUnsignedInt(nVal);
if (ten > 9)
ten = 9;
NikuRecord.setTenths(ten);
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(Main.window, "Input \"" + nVal + "\" was not a valid number!",
Expand Down

0 comments on commit 2b95708

Please sign in to comment.