Skip to content

Commit

Permalink
Fix a bug when importing project into an unsaved project
Browse files Browse the repository at this point in the history
  • Loading branch information
まいこ committed May 8, 2024
1 parent bd73561 commit ab52833
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion OpenUtau.Core/Ustx/UPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,13 @@ public override void BeforeSave(UProject project, UTrack track) {
}

public override void AfterLoad(UProject project, UTrack track) {
FilePath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(project.FilePath), relativePath ?? ""));
try {
FilePath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(project.FilePath), relativePath ?? ""));
} catch {
if (string.IsNullOrWhiteSpace(FilePath)) {
throw;
}
}
Load(project);
}
}
Expand Down

0 comments on commit ab52833

Please sign in to comment.