`code = code || 500` should do it