{"record":{"id":"485c69dd28c67719","repo":"nopSolutions/nopCommerce","slug":"no-vendor-note-found-with-the-specified-id","errorCode":null,"errorMessage":"No vendor note found with the specified id","messagePattern":"No vendor note found with the specified id","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Presentation/Nop.Web/Areas/Admin/Controllers/VendorController.cs","lineNumber":535,"sourceCode":"            return ErrorJson(\"Vendor cannot be loaded\");\n\n        await _vendorService.InsertVendorNoteAsync(new VendorNote\n        {\n            Note = message,\n            CreatedOnUtc = DateTime.UtcNow,\n            VendorId = vendor.Id\n        });\n\n        return Json(new { Result = true });\n    }\n\n    [HttpPost]\n    [CheckPermission(StandardPermission.Customers.VENDORS_CREATE_EDIT_DELETE)]\n    public virtual async Task<IActionResult> VendorNoteDelete(int id)\n    {\n        //try to get a vendor note with the specified id\n        var vendorNote = await _vendorService.GetVendorNoteByIdAsync(id)\n            ?? throw new ArgumentException(\"No vendor note found with the specified id\", nameof(id));\n\n        await _vendorService.DeleteVendorNoteAsync(vendorNote);\n\n        return new NullJsonResult();\n    }\n\n    #endregion\n}","sourceCodeStart":517,"sourceCodeEnd":543,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Presentation/Nop.Web/Areas/Admin/Controllers/VendorController.cs#L517-L543","documentation":"Thrown by VendorController.VendorNoteDelete when GetVendorNoteByIdAsync(id) returns null. The delete action (behind VENDORS_CREATE_EDIT_DELETE permission) removes a vendor note by id; a null lookup throws ArgumentException before DeleteVendorNoteAsync. This closes the vendor notes region of the controller.","triggerScenarios":"Double-click on 'delete note' in the vendor-notes grid; the first call succeeds and the second hits null. Concurrent deletion from another session. A programmatic delete with a stale note id.","commonSituations":"User double-clicks the note delete control. Another admin removed the note between page load and delete. The note was auto-removed by a cleanup routine while a stale grid still displayed it.","solutions":["Dismiss the error and reload the notes grid; the note is already deleted.","Disable the delete button after first click to prevent double-submission.","For API callers, treat null as idempotent success.","Wrap the action to return NullJsonResult on a missing note."],"exampleFix":"// before\nvar vendorNote = await _vendorService.GetVendorNoteByIdAsync(id)\n    ?? throw new ArgumentException(\"No vendor note found with the specified id\", nameof(id));\nawait _vendorService.DeleteVendorNoteAsync(vendorNote);\n\n// after\nvar vendorNote = await _vendorService.GetVendorNoteByIdAsync(id);\nif (vendorNote is null)\n    return new NullJsonResult(); // idempotent","handlingStrategy":"validation","validationCode":"var note = await _vendorService.GetVendorNoteByIdAsync(id);\nif (note is null)\n    return; // already deleted — idempotent","typeGuard":null,"tryCatchPattern":"try { await controller.VendorNoteDelete(id); }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"No vendor note\"))\n{ /* note already removed — no-op */ }","preventionTips":["Disable the delete button after first click.","Refresh the vendor-notes grid after each delete.","Treat not-found as success in idempotent delete operations."],"tags":["nopcommerce","admin-controller","not-found","vendor","vendor-notes","delete","argument-exception"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}