mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
fixing MissingReferenceException (#1624)
This commit is contained in:
parent
deb286f0c2
commit
dcb618bfd6
@ -74,7 +74,8 @@ public override GUIContent GetPreviewTitle()
|
||||
|
||||
public override bool HasPreviewGUI()
|
||||
{
|
||||
return target is GameObject gameObject && gameObject.GetComponent<NetworkIdentity>() != null;
|
||||
// need to check if target is null to stop MissingReferenceException
|
||||
return target != null && target is GameObject gameObject && gameObject.GetComponent<NetworkIdentity>() != null;
|
||||
}
|
||||
|
||||
public override void OnPreviewGUI(Rect r, GUIStyle background)
|
||||
|
Loading…
Reference in New Issue
Block a user