fix(worker): handle NULL map_json fields with COALESCE
map_json generated by acb-map-evolver lacks a 'spawns' key; scanning map_json->>'spawns' into a non-nullable string causes "converting NULL to string is unsupported". Use COALESCE for walls/spawns/cores. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
181e846d8a
commit
9b16b32aef
1 changed files with 2 additions and 2 deletions
|
|
@ -185,8 +185,8 @@ func (c *DBClient) ClaimJob(ctx context.Context, jobID string, workerID string)
|
|||
// Get map data
|
||||
var mapData DBMapData
|
||||
err = tx.QueryRowContext(ctx, `
|
||||
SELECT map_id, grid_width, grid_height, map_json->>'walls' as walls,
|
||||
map_json->>'spawns' as spawns, map_json->>'cores' as cores
|
||||
SELECT map_id, grid_width, grid_height, COALESCE(map_json->>'walls', '') as walls,
|
||||
COALESCE(map_json->>'spawns', '') as spawns, COALESCE(map_json->>'cores', '') as cores
|
||||
FROM maps WHERE map_id = $1
|
||||
`, match.MapID).Scan(
|
||||
&mapData.ID, &mapData.Width, &mapData.Height,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue