Skip to content

Commit 0ee91cf

Browse files
authored
Merge pull request #217 from context-hub/hotfix/mcp-projects-path-normalizing
fix
2 parents c045cc6 + 8de808d commit 0ee91cf

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/McpServer/Projects/DTO/CurrentProjectDTO.php

+7-4
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,13 @@ public static function fromArray(?array $data): ?self
3131
return null;
3232
}
3333

34+
$configFile = $data['config_file'] ?? null;
35+
$envFile = $data['env_file'] ?? null;
36+
3437
return new self(
3538
path: (string) FSPath::create($data['path']),
36-
configFile: (string) FSPath::create($data['config_file'] ?? null),
37-
envFile: (string) FSPath::create($data['env_file'] ?? null),
39+
configFile: $configFile ? (string) FSPath::create($configFile) : null,
40+
envFile: $envFile ? (string) FSPath::create($envFile) : null,
3841
);
3942
}
4043

@@ -79,8 +82,8 @@ public function jsonSerialize(): array
7982
{
8083
return [
8184
'path' => (string) FSPath::create($this->path),
82-
'config_file' => (string) FSPath::create($this->configFile),
83-
'env_file' => (string) FSPath::create($this->envFile),
85+
'config_file' => $this->configFile ? (string) FSPath::create($this->configFile) : null,
86+
'env_file' => $this->envFile ? (string) FSPath::create($this->envFile) : null,
8487
];
8588
}
8689
}

0 commit comments

Comments
 (0)