Fixed issues found by PVS-Studio

This commit is contained in:
Wojtek Figat
2024-09-09 18:21:59 +02:00
parent c62575612b
commit bbb0d36494
11 changed files with 31 additions and 34 deletions

View File

@@ -57,8 +57,9 @@ namespace FlaxEditor.States
{
// Generate project files when Cache is missing or was cleared previously
var projectFolderPath = Editor.GameProject?.ProjectFolderPath;
if (!Directory.Exists(Path.Combine(projectFolderPath, "Cache", "Intermediate")) ||
!Directory.Exists(Path.Combine(projectFolderPath, "Cache", "Projects")))
if (!string.IsNullOrEmpty(projectFolderPath) &&
(!Directory.Exists(Path.Combine(projectFolderPath, "Cache", "Intermediate")) ||
!Directory.Exists(Path.Combine(projectFolderPath, "Cache", "Projects"))))
{
var customArgs = Editor.CodeEditing.SelectedEditor?.GenerateProjectCustomArgs;
ScriptsBuilder.GenerateProject(customArgs);