diff --git a/ivette/src/frama-c/states.js b/ivette/src/frama-c/states.js index 92308d76dd0c2ea48054ae16fbcd65eb125efbbe..8477f4e7c792ba9c01ac0287c22d45758c3f3265 100644 --- a/ivette/src/frama-c/states.js +++ b/ivette/src/frama-c/states.js @@ -72,7 +72,8 @@ export function setProject(project) export function clearProject(project) { const theProject = project || currentProject ; - _.unset( globalStates , ['states',theProject] ); + if (theProject) + _.unset( globalStates , [theProject] ); Dome.emit(PROJECT); } @@ -101,7 +102,7 @@ export function useState(id,project) Dome.useUpdate(PROJECT,theEvent); const theProject = project || currentProject ; if (!theProject) return NONE; - const thePath = ['states',theProject,id] ; + const thePath = [theProject,id] ; const theValue = _.get( globalStates, thePath ); const setValue = (v) => { Dome.emit(theEvent,v);