File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
com.unity.netcode.gameobjects/Runtime/Core Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -396,19 +396,28 @@ internal void UnifiedValidation()
396396
397397 private void SortToTop ( )
398398 {
399+ if ( gameObject == null )
400+ {
401+ return ;
402+ }
399403 // Move the bridge to the top
400- while ( UnityEditorInternal . ComponentUtility . MoveComponentUp ( NetworkObjectBridge ) )
404+ while ( NetworkObjectBridge != null && UnityEditorInternal . ComponentUtility . MoveComponentUp ( NetworkObjectBridge ) )
401405 {
402406 // Keep moving until it can't go higher
403407 }
404408
405409 // Now move the GhostAdapter to the top so it is above NetworkObjectBridge
406- while ( UnityEditorInternal . ComponentUtility . MoveComponentUp ( GhostAdapter ) )
410+ while ( GhostAdapter != null && UnityEditorInternal . ComponentUtility . MoveComponentUp ( GhostAdapter ) )
407411 {
408412 // Keep moving until it can't go higher
409413 }
410-
411- EditorUtility . SetDirty ( gameObject ) ;
414+
415+ if ( gameObject != null )
416+ {
417+ EditorUtility . SetDirty ( gameObject ) ;
418+ return ;
419+ }
420+
412421 }
413422#endif
414423#endif
You can’t perform that action at this time.
0 commit comments