File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
RasterPropMonitor/Auxiliary modules Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -329,12 +329,15 @@ void LateUpdate()
329329
330330 void OnDestroy ( )
331331 {
332- RasterPropMonitorComputer rpmComp = RasterPropMonitorComputer . FindFromProp ( internalProp ) ;
333- foreach ( var labelBatch in labelBatches )
332+ if ( part != null )
334333 {
335- if ( labelBatch . Key . variableName != null )
334+ RasterPropMonitorComputer rpmComp = RasterPropMonitorComputer . FindFromProp ( internalProp ) ;
335+ foreach ( var labelBatch in labelBatches )
336336 {
337- rpmComp . UnregisterVariableCallback ( labelBatch . Key . variableName , labelBatch . Value . VariableChangedCallback ) ;
337+ if ( labelBatch . Key . variableName != null )
338+ {
339+ rpmComp . UnregisterVariableCallback ( labelBatch . Key . variableName , labelBatch . Value . VariableChangedCallback ) ;
340+ }
338341 }
339342 }
340343 }
You can’t perform that action at this time.
0 commit comments