InjectLogic: Don't try to create null parent

This commit is contained in:
Juuz
2023-04-30 01:34:24 +03:00
parent 827698d5d1
commit 2d6218686e

View File

@@ -1,7 +1,7 @@
/*
* This file is part of fabric-loom, licensed under the MIT License (MIT).
*
* Copyright (c) 2022 FabricMC
* Copyright (c) 2022-2023 FabricMC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -53,7 +53,11 @@ public final class InjectLogic implements StepLogic {
Path from = iter.next();
Path relative = injectedFiles.relativize(from);
Path to = fs.getPath(relative.toString().replace(relative.getFileSystem().getSeparator(), "/"));
Files.createDirectories(to.getParent());
if (to.getParent() != null) {
Files.createDirectories(to.getParent());
}
Files.copy(from, to, StandardCopyOption.REPLACE_EXISTING);
}
}