Skip to content

Commit 4910b3a

Browse files
Merge pull request #88 from VPDPersonal/master
Fix "ArgumentException: Empty path name is not legal" when assetPath is empty
2 parents 0b4a582 + a754a2d commit 4910b3a

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

Editor/Dropdown/SerializeReferencePropertyDrawer_UIToolkit.cs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,22 @@ void RefreshDropdown(SerializedObject so)
159159
var selectedType = TypeUtils.ExtractTypeFromString(prop.managedReferenceFullTypename);
160160
var selectedTypeName = GetTypeName(selectedType);
161161
var tooltipText = $"Type Full Name: {selectedType?.FullName}";
162-
var isMissingType = TryGetMissingType(property, assetPath, out var missingType);
163-
if (isMissingType)
162+
163+
var isMissingType = false;
164+
165+
if (!string.IsNullOrEmpty(assetPath))
164166
{
165-
selectedTypeName = $"MISSING TYPE: {missingType.className}";
166-
tooltipText = missingType.GetDetailData();
167-
selectTypeButton.AddToClassList("error-bg");
167+
isMissingType = TryGetMissingType(property, assetPath, out var missingType);
168+
169+
if (isMissingType)
170+
{
171+
selectedTypeName = $"MISSING TYPE: {missingType.className}";
172+
tooltipText = missingType.GetDetailData();
173+
selectTypeButton.AddToClassList("error-bg");
174+
}
168175
}
169-
else
176+
177+
if (!isMissingType)
170178
{
171179
selectTypeButton.RemoveFromClassList("error-bg");
172180
}
@@ -250,4 +258,4 @@ void ShowModifyWindow(TypeData typeData, long refId)
250258
}
251259
}
252260
}
253-
}
261+
}

0 commit comments

Comments
 (0)