File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
RasterPropMonitor/Auxiliary modules Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -482,8 +482,10 @@ public void Start()
482482 persistentVarValid = ! string . IsNullOrEmpty ( persistentVarName ) ;
483483 if ( persistentVarValid )
484484 {
485- // fetch the variable once before registering a callback for it, because otherwise the default value will be -1 on creation
486- rpmComp . GetPersistentVariable ( persistentVarName , initialState , perPodPersistenceIsGlobal ) ;
485+ if ( ! rpmComp . HasPersistentVariable ( persistentVarName , perPodPersistenceIsGlobal ) )
486+ {
487+ rpmComp . SetPersistentVariable ( persistentVarName , initialState , perPodPersistenceIsGlobal ) ;
488+ }
487489 rpmComp . RegisterVariableCallback ( "PERSISTENT_" + persistentVarName , PersistentVarChangedCallback ) ;
488490 }
489491 }
You can’t perform that action at this time.
0 commit comments