nopSolutions/nopCommerce · error · ArgumentException
No product video found with the specified id
Error message
No product video found with the specified id
What it means
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.
Source
Thrown at src/Presentation/Nop.Web/Areas/Admin/Controllers/ProductController.cs:2357
//a vendor should have access only to his products
var currentVendor = await _workContext.GetCurrentVendorAsync();
if (currentVendor != null && product.VendorId != currentVendor.Id)
return Content("This is not your product");
//prepare model
var model = await _productModelFactory.PrepareProductVideoListModelAsync(searchModel, product);
return Json(model);
}
[HttpPost]
[CheckPermission(StandardPermission.Catalog.PRODUCTS_CREATE_EDIT_DELETE)]
public virtual async Task<IActionResult> ProductVideoUpdate([Validate] ProductVideoModel model)
{
//try to get a product picture with the specified id
var productVideo = await _productService.GetProductVideoByIdAsync(model.Id)
?? throw new ArgumentException("No product video found with the specified id");
//a vendor should have access only to his products
var currentVendor = await _workContext.GetCurrentVendorAsync();
if (currentVendor != null)
{
var product = await _productService.GetProductByIdAsync(productVideo.ProductId);
if (product != null && product.VendorId != currentVendor.Id)
return Content("This is not your product");
}
//try to get a video with the specified id
var video = await _videoService.GetVideoByIdAsync(productVideo.VideoId)
?? throw new ArgumentException("No video found with the specified id");
var videoUrl = model.VideoUrl.TrimStart('~');
try
{View on GitHub (pinned to 64bdf2ff08)
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.
Example fix
// before
var productVideo = await _productService.GetProductVideoByIdAsync(model.Id)
?? throw new ArgumentException("No product video found with the specified id");
// after
var productVideo = await _productService.GetProductVideoByIdAsync(model.Id);
if (productVideo == null)
return Json(new { success = false, message = "Video mapping no longer exists." }); Defensive patterns
Strategy: validation
Validate before calling
var productVideo = await _productService.GetProductVideoByIdAsync(model.Id);
if (productVideo == null)
return Json(new { success = false, message = "Video mapping no longer exists." }); Try / catch
try { /* update */ }
catch (ArgumentException ex) when (ex.Message.Contains("product video"))
return Json(new { success = false, message = ex.Message }); Prevention
- Refresh the videos grid before editing
- Avoid concurrent video edits
- Return JSON errors instead of throwing
When it happens
Trigger: POST Admin/Product/ProductVideoUpdate with model.Id of a ProductVideo row removed (video deleted, mapping cleared) between grid render and the update post.
Common situations: Concurrent video management on the same product; one deletes while the other edits. Grid not refreshed after a video deletion.
Related errors
- No associated product found with the specified id
- No product picture found with the specified id
- No product tag found with the specified id
- No video found with the specified id
- No activity log found with the specified id
AI-assisted analysis of nopSolutions/nopCommerce@64bdf2ff08 (2026-08-13).
Data as JSON: /api/errors/0bebdfb17acfc4e6.
Report an issue: GitHub.