Compare commits

...
Author SHA1 Message Date
Chirag AggarwalandClaude e6baa6df7f Fix undefined adapter variable in build worker
The $adapter variable was only initialized inside a conditional block
(when resource is a site AND detectionLogs is not empty), but was used
unconditionally when calling afterBuildSuccess().

This caused the adapter field to potentially contain unexpected values
when:
1. The resource is a function (not a site), OR
2. The resource is a site but detectionLogs is empty

Initialize $adapter to null before the conditional block to ensure it
always has a defined value.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-06 14:32:49 +05:30
@@ -868,6 +868,7 @@ class Builds extends Action
$deployment->setAttribute('buildLogs', $logs);
$adapter = null;
if ($resource->getCollection() === 'sites' && !empty($detectionLogs)) {
$files = \explode("\n", $detectionLogs); // Parse output
$files = \array_filter($files); // Remove empty