{"record":{"id":"0bebdfb17acfc4e6","repo":"nopSolutions/nopCommerce","slug":"no-product-video-found-with-the-specified-id","errorCode":null,"errorMessage":"No product video found with the specified id","messagePattern":"No product video found with the specified id","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Presentation/Nop.Web/Areas/Admin/Controllers/ProductController.cs","lineNumber":2357,"sourceCode":"\n        //a vendor should have access only to his products\n        var currentVendor = await _workContext.GetCurrentVendorAsync();\n        if (currentVendor != null && product.VendorId != currentVendor.Id)\n            return Content(\"This is not your product\");\n\n        //prepare model\n        var model = await _productModelFactory.PrepareProductVideoListModelAsync(searchModel, product);\n\n        return Json(model);\n    }\n\n    [HttpPost]\n    [CheckPermission(StandardPermission.Catalog.PRODUCTS_CREATE_EDIT_DELETE)]\n    public virtual async Task<IActionResult> ProductVideoUpdate([Validate] ProductVideoModel model)\n    {\n        //try to get a product picture with the specified id\n        var productVideo = await _productService.GetProductVideoByIdAsync(model.Id)\n            ?? throw new ArgumentException(\"No product video found with the specified id\");\n\n        //a vendor should have access only to his products\n        var currentVendor = await _workContext.GetCurrentVendorAsync();\n        if (currentVendor != null)\n        {\n            var product = await _productService.GetProductByIdAsync(productVideo.ProductId);\n            if (product != null && product.VendorId != currentVendor.Id)\n                return Content(\"This is not your product\");\n        }\n\n        //try to get a video with the specified id\n        var video = await _videoService.GetVideoByIdAsync(productVideo.VideoId)\n            ?? throw new ArgumentException(\"No video found with the specified id\");\n\n        var videoUrl = model.VideoUrl.TrimStart('~');\n\n        try\n        {","sourceCodeStart":2339,"sourceCodeEnd":2375,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Presentation/Nop.Web/Areas/Admin/Controllers/ProductController.cs#L2339-L2375","documentation":"Thrown by ProductVideoUpdate when _productService.GetProductVideoByIdAsync(model.Id) returns null. model.Id is the ProductVideo mapping row being edited (DisplayOrder/URL), posted from the videos grid inline editor.","triggerScenarios":"POST Admin/Product/ProductVideoUpdate with model.Id of a ProductVideo row removed (video deleted, mapping cleared) between grid render and the update post.","commonSituations":"Concurrent video management on the same product; one deletes while the other edits. Grid not refreshed after a video deletion.","solutions":["Refresh the videos grid before inline editing.","Replace the throw with a null guard returning Json(new { success = false }).","Avoid simultaneous video edits on the same product.","Batch video operations rather than interleaving with manual edits."],"exampleFix":"// before\nvar productVideo = await _productService.GetProductVideoByIdAsync(model.Id)\n    ?? throw new ArgumentException(\"No product video found with the specified id\");\n\n// after\nvar productVideo = await _productService.GetProductVideoByIdAsync(model.Id);\nif (productVideo == null)\n    return Json(new { success = false, message = \"Video mapping no longer exists.\" });","handlingStrategy":"validation","validationCode":"var productVideo = await _productService.GetProductVideoByIdAsync(model.Id);\nif (productVideo == null)\n    return Json(new { success = false, message = \"Video mapping no longer exists.\" });","typeGuard":null,"tryCatchPattern":"try { /* update */ }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"product video\"))\n    return Json(new { success = false, message = ex.Message });","preventionTips":["Refresh the videos grid before editing","Avoid concurrent video edits","Return JSON errors instead of throwing"],"tags":["nopcommerce","aspnet-mvc","admin","ajax","video","not-found","concurrency","argument-exception"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}