@@ -74,6 +74,8 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
74
74
foreach ( var avfx in avfxSets )
75
75
{
76
76
var avfxStuff = await ATex . GetVfxPath ( Source . Info , avfx ) ;
77
+ if ( String . IsNullOrEmpty ( avfxStuff . Folder ) || String . IsNullOrEmpty ( avfxStuff . File ) ) continue ;
78
+
77
79
var path = avfxStuff . Folder + "/" + avfxStuff . File ;
78
80
if ( await _index . FileExists ( path ) )
79
81
{
@@ -159,21 +161,24 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
159
161
ProgressReporter . Report ( "Removing existing modifications to destination root..." ) ;
160
162
}
161
163
162
- var dPath = Destination . Info . GetRootFolder ( ) ;
163
- foreach ( var mod in modlist . Mods )
164
+ if ( Destination != Source )
164
165
{
165
- if ( mod . fullPath . StartsWith ( dPath ) && ! mod . IsInternal ( ) )
166
+ var dPath = Destination . Info . GetRootFolder ( ) ;
167
+ foreach ( var mod in modlist . Mods )
166
168
{
167
- if ( Destination . Info . SecondaryType != null || Destination . Info . Slot == null )
169
+ if ( mod . fullPath . StartsWith ( dPath ) && ! mod . IsInternal ( ) )
168
170
{
169
- // If this is a slotless root, purge everything.
170
- await _modding . DeleteMod ( mod . fullPath , false ) ;
171
- }
172
- else if ( allFiles . Contains ( mod . fullPath ) || mod . fullPath . Contains ( Destination . Info . Slot ) )
173
- {
174
- // Otherwise, only purge the files we're replacing, and anything else that
175
- // contains our slot name.
176
- await _modding . DeleteMod ( mod . fullPath , false ) ;
171
+ if ( Destination . Info . SecondaryType != null || Destination . Info . Slot == null )
172
+ {
173
+ // If this is a slotless root, purge everything.
174
+ await _modding . DeleteMod ( mod . fullPath , false ) ;
175
+ }
176
+ else if ( allFiles . Contains ( mod . fullPath ) || mod . fullPath . Contains ( Destination . Info . Slot ) )
177
+ {
178
+ // Otherwise, only purge the files we're replacing, and anything else that
179
+ // contains our slot name.
180
+ await _modding . DeleteMod ( mod . fullPath , false ) ;
181
+ }
177
182
}
178
183
}
179
184
}
@@ -190,6 +195,10 @@ public static async Task CloneRoot(XivDependencyRoot Source, XivDependencyRoot D
190
195
var dst = kv . Value ;
191
196
var xmdl = await _mdl . GetRawMdlData ( src ) ;
192
197
var tmdl = TTModel . FromRaw ( xmdl ) ;
198
+
199
+ if ( xmdl == null || tmdl == null )
200
+ continue ;
201
+
193
202
tmdl . Source = dst ;
194
203
xmdl . MdlPath = dst ;
195
204
0 commit comments