Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

fix: Race condition NPE for timer overlay #676

Open
wants to merge 6 commits into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,16 @@ public static void addDynamicTimer(String name, int initialTimeSeconds, boolean
*/
public static void addStaticTimer(String prefix, String name, String displayedTime, boolean persistent) {
// If a DynamicTimerContainer or StaticTimerContainer already exists, get rid of it
activeTimers.remove(findTimerContainer(name));
removeTimer(name);

activeTimers.add(new StaticTimerContainer(prefix, name, displayedTime, persistent));
}

public static void removeTimer(String name) {
activeTimers.remove(findTimerContainer(name));
TimerContainer timerContainer = findTimerContainer(name);
if (timerContainer != null) {
activeTimers.remove(timerContainer);
}
}

@Override
Expand Down
Loading