I would handle it in that same line with null coalescing. I wouldn't map all undefined or null to [] via middleware, as that can lead to problems down the line if you need to handle things differently.
return { items: findItemById(idParam) ?? [] }