Skip to content

Commit

Permalink
Fixing workbench init context implementation
Browse files Browse the repository at this point in the history
Init context add timer could cause null pointer exception if model instances didn't exist.
  • Loading branch information
ripleyb committed Jan 24, 2024
1 parent 35ebad8 commit f07ed76
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ void addDigitalTwin(String digitalTwinModelName, MessageProcessor digitalTwinMes
}

void addTimer(String modelName, String id, String timerName, TimerType type, Duration interval, TimerHandler handler) {

ConcurrentHashMap<String,TwinProxy> modelInstances = _modelInstances.get(modelName);
if(modelInstances == null) {
modelInstances = new ConcurrentHashMap<>();
}
TwinProxy proxy = modelInstances.get(id);
SimulationScheduler scheduler = _simulationSchedulers.get(modelName);
if (scheduler != null) {
Expand Down

0 comments on commit f07ed76

Please sign in to comment.