Skip to content

Commit

Permalink
fix(PathAttribute): do not mutate Path instance variable in GetAssetP…
Browse files Browse the repository at this point in the history
…athForComponent
  • Loading branch information
jonisavo committed May 1, 2022
1 parent ecd9c7d commit cb01f27
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Core/PathAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using UnityEditor;
using UnityEngine;

namespace UIComponents.Core
{
Expand All @@ -10,10 +11,10 @@ public abstract class PathAttribute : Attribute
public string GetAssetPathForComponent(UIComponent component)
{
if (Path == null)
Path = string.Empty;
return string.Empty;

if (!ConfiguredPathIsComplete() && TryGetPathFromComponent(component, out var path))
Path = path;
return path;

return Path;
}
Expand Down

0 comments on commit cb01f27

Please sign in to comment.