Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6d5c157

Browse files
committed
Small fixes
1 parent 2cb0c1e commit 6d5c157

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/fxsimulator/CanvasController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,15 +503,15 @@ public void PlayPauseHandle(ActionEvent event) {
503503
System.out.println(playing + " " + paused);
504504

505505
try{
506-
if (playing && st.getStatus() == Animation.Status.RUNNING) {
506+
if (playing && st != null && st.getStatus() == Animation.Status.RUNNING) {
507507
Image image = new Image(getClass().getResourceAsStream("/play_arrow_black_48x48.png"));
508508
playPauseImage.setImage(image);
509509
System.out.println("Pausing");
510510
st.pause();
511511
paused = true;
512512
playing = false;
513513
return;
514-
} else if (paused) {
514+
} else if (paused && st != null) {
515515
Image image = new Image(getClass().getResourceAsStream("/pause_black_48x48.png"));
516516
playPauseImage.setImage(image);
517517
if(st.getStatus() == Animation.Status.PAUSED)

0 commit comments

Comments
 (0)