Skip to content

Fix two stopwatch NPEs (Reset-before-Start, Stop-before-Start)#8

Merged
jumincho merged 1 commit into
mainfrom
claude/beautiful-dirac-KTp5x
May 29, 2026
Merged

Fix two stopwatch NPEs (Reset-before-Start, Stop-before-Start)#8
jumincho merged 1 commit into
mainfrom
claude/beautiful-dirac-KTp5x

Conversation

@jumincho
Copy link
Copy Markdown
Owner

Two real NullPointerException crashes in the study-timer, found reading the timer code line-by-line:

  • CircularTimerView.stop() dereferenced timerTask unconditionally. reset() calls stop(), and timerTask is null until start() is first called — so pressing Reset before Start crashed. Guarded the cancel() with a null check.
  • TimerActivity Stop-before-Start. Pressing Stop before Start left start_time == null, and the interval logging then called sdf.format(null) → NPE. Skip recording when there is no start time.

Both are minimal guards with no change to the normal start→stop→reset path. (No Gradle build available in CI here, so reasoned from source.)


Generated by Claude Code

- CircularTimerView.stop(): guard timerTask before cancel(). reset() calls
  stop() before any start(), but timerTask is null until start() — so hitting
  Reset before Start crashed with a NullPointerException.
- TimerActivity: pressing Stop before Start left start_time null, and the
  interval formatting then NPE'd on sdf.format(null). Skip recording when
  there is no start time.
@jumincho jumincho merged commit ebc9014 into main May 29, 2026
1 check passed
@jumincho jumincho deleted the claude/beautiful-dirac-KTp5x branch May 29, 2026 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant