fix(server): don't throw error on reinstall if there's no body

This commit is contained in:
CyberL1 2025-01-14 14:20:20 -05:00
parent 5c803c53e4
commit 85a8dc9ccb

View File

@ -21,9 +21,11 @@ export default (fastify: FastifyInstance) => {
Body: CreateContainerBody; Body: CreateContainerBody;
}>, }>,
) => { ) => {
if (req.body) {
if (!(await getImage(req.body?.image).inspect()).Id) { if (!(await getImage(req.body?.image).inspect()).Id) {
return; return;
} }
}
const oldContainer = getContainer(req.params.id); const oldContainer = getContainer(req.params.id);
const name = (await oldContainer.inspect()).Name; const name = (await oldContainer.inspect()).Name;