Nop version 4.6 develop I got the error when Add product video in product edit page without Embed video URL (and check log) Please fix it aspe ----------------------------------------------------------------- Exception ----------------------------------------------------------------- System.NullReferenceException: Object reference not set to an instance of an object. at Nop.Web.Areas.Admin.Controllers.ProductController.ProductVideoAdd(Int32 productId, ProductVideoModel model) in C:\andrei\nopcommerce\demo_sites\sources\src\Presentation\Nop.Web\Areas\Admin\Controllers\ProductController.cs:line 1813
[HttpPost] public virtual async Task<IActionResult> ProductVideoAdd(int productId, [Validate] ProductVideoModel model) { if (!await _permissionService.AuthorizeAsync(StandardPermissionProvider.ManageProducts)) return AccessDeniedView(); if (productId == 0) throw new ArgumentException();
//try to get a product with the specified id var product = await _productService.GetProductByIdAsync(productId) ?? throw new ArgumentException("No product found with the specified id");
var videoUrl = model?.VideoUrl?.TrimStart('~');
try { if (!string.IsNullOrEmpty(model.VideoUrl)) { await PingVideoUrlAsync(videoUrl); } else { return Json(new { success = false, error = $"{await _localizationService.GetResourceAsync("Embed video URL is Empty")}", }); } }