C#C
C#9mo ago
morry329#

Cannot return null from an action method with a return type of 'Microsoft.AspNetCore.Mvc.JsonResult'

Context: I created a simple app which displays card view items on view. I have added a file picker in there. Once the file picker selected an image and the save button has been clicked, my code triggered the exception System.InvalidOperationException: Cannot return null from an action method with a return type of 'Microsoft.AspNetCore.Mvc.JsonResult'.

My Rider does not let me debug like this (as per attached screenshot) so I have no idea what caused this exception.


My full code here. Could anyone kindly point me in the right direction?
https://paste.mod.gg/bnhhtfmvhaku/0
Bildschirmfoto_2025-03-30_um_13.45.18.png
A tool for sharing your source code with the world!
Was this page helpful?