diff --git a/Assets/Scripts/Controller/DeviceController.cs b/Assets/Scripts/Controller/DeviceController.cs index 1d9444a7..5b7b7195 100644 --- a/Assets/Scripts/Controller/DeviceController.cs +++ b/Assets/Scripts/Controller/DeviceController.cs @@ -41,8 +41,8 @@ public class DeviceController : MonoSingleton if (string.IsNullOrEmpty(device.Path) == false) { obj = Utility.FindObj(device.Path); - item = obj.GetOrAddComponent(); - item.Init(device); + item = obj?.GetOrAddComponent(); + item?.Init(device); } deviceDict.Add(device.Name, new DeviceData() { device = device, item = item }); }