Skip to content

Commit 6e0d23f

Browse files
committed
Allow cloning roots to new, non-existent roots.
1 parent 94b86a1 commit 6e0d23f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

xivModdingFramework/Mods/RootCloner.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,14 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
8989
// First, get a new, clean copy of the metadata, pointed at the new root.
9090
var newMetadata = await ItemMetadata.GetMetadata(Source);
9191
newMetadata.Root = Destination.Info.ToFullRoot();
92-
var originalDestinationMetadata = await ItemMetadata.GetMetadata(Destination);
92+
ItemMetadata originalDestinationMetadata = null;
93+
try
94+
{
95+
originalDestinationMetadata = await ItemMetadata.GetMetadata(Destination);
96+
} catch
97+
{
98+
originalDestinationMetadata = new ItemMetadata(Destination);
99+
}
93100

94101
// Set 0 needs special handling.
95102
if(Source.Info.PrimaryType == XivItemType.equipment && Source.Info.PrimaryId == 0)

0 commit comments

Comments
 (0)