{"record":{"id":"73eebc57d4ef9e45","repo":"nopSolutions/nopCommerce","slug":"no-vendor-attribute-value-found-with-the-specified","errorCode":null,"errorMessage":"No vendor attribute value found with the specified id","messagePattern":"No vendor attribute value found with the specified id","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Presentation/Nop.Web/Areas/Admin/Controllers/VendorAttributeController.cs","lineNumber":339,"sourceCode":"            ViewBag.RefreshPage = true;\n\n            return View(model);\n        }\n\n        //prepare model\n        model = await _vendorAttributeModelFactory.PrepareVendorAttributeValueModelAsync(model, vendorAttribute, vendorAttributeValue, true);\n\n        //if we got this far, something failed, redisplay form\n        return View(model);\n    }\n\n    [HttpPost]\n    [CheckPermission(StandardPermission.Configuration.MANAGE_SETTINGS)]\n    public virtual async Task<IActionResult> ValueDelete(int id)\n    {\n        //try to get a vendor attribute value with the specified id\n        var value = await _vendorAttributeService.GetAttributeValueByIdAsync(id)\n            ?? throw new ArgumentException(\"No vendor attribute value found with the specified id\", nameof(id));\n\n        await _vendorAttributeService.DeleteAttributeValueAsync(value);\n\n        //activity log\n        await _customerActivityService.InsertActivityAsync(\"DeleteVendorAttributeValue\",\n            string.Format(await _localizationService.GetResourceAsync(\"ActivityLog.DeleteVendorAttributeValue\"), value.Id), value);\n\n        return new NullJsonResult();\n    }\n\n    #endregion\n}","sourceCodeStart":321,"sourceCodeEnd":351,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Presentation/Nop.Web/Areas/Admin/Controllers/VendorAttributeController.cs#L321-L351","documentation":"Thrown by VendorAttributeController.ValueDelete when GetAttributeValueByIdAsync(id) returns null. The delete action (behind MANAGE_SETTINGS permission) removes a vendor attribute value by id and logs the activity; a null lookup throws ArgumentException before DeleteAttributeValueAsync. Notably, the activity-log message uses the value's Id, so the lookup must succeed before logging.","triggerScenarios":"Double-click on 'delete value' in the vendor-attribute-values grid; the first request succeeds and the second hits a null lookup. Concurrent deletion from another session. A programmatic delete with a stale value id.","commonSituations":"User rapidly clicks delete twice. Another admin or background sync removed the value between page load and the delete confirmation. The parent vendor attribute was deleted, cascading value removal, while a stale grid still shows the value.","solutions":["Dismiss the error and reload the values grid; the value is already removed.","Disable the delete button after the first click to prevent double-submission.","For API callers, treat null as idempotent success.","Wrap the action to return NullJsonResult when the value is already absent."],"exampleFix":"// before\nvar value = await _vendorAttributeService.GetAttributeValueByIdAsync(id)\n    ?? throw new ArgumentException(\"No vendor attribute value found with the specified id\", nameof(id));\nawait _vendorAttributeService.DeleteAttributeValueAsync(value);\n\n// after\nvar value = await _vendorAttributeService.GetAttributeValueByIdAsync(id);\nif (value is null)\n    return new NullJsonResult(); // idempotent","handlingStrategy":"validation","validationCode":"var value = await _vendorAttributeService.GetAttributeValueByIdAsync(id);\nif (value is null)\n    return; // already deleted — idempotent","typeGuard":null,"tryCatchPattern":"try { await controller.ValueDelete(id); }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"No vendor attribute value\"))\n{ /* value already removed — no-op */ }","preventionTips":["Prevent double-click on the value delete control.","Refresh the values grid after each delete.","Treat not-found as idempotent success in batch scripts."],"tags":["nopcommerce","admin-controller","not-found","vendor-attribute","delete","argument-exception"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}