I'm assuming you have some fluid markup that looks like:
<f:link.action action="delete" arguments="{upload:uploadObjectToDelete}" > ...
Which says: pass the uploadObjectToDelete
object to the delete action when the user clicks on this link. And when the user clicks on that link the ExtBase PropertyMapper
uses the arguments sent with the link to locate the uploadObjectToDelete
in the database to hand it off to your controller and the delete action.
After the first click, that delete action successfully deletes the object from the database and the page is reloaded when you redirect to the list action. However, this time the uploadObjectToDelete
object is null. So, for the second click, when the PropertyMapper
tries to locate an upload
argument for the delete action there is no object to look for. And since the upload
argument is required (i.e. can't be null
), you get an exception.
Option 1
Change your list action so that it doesn't show these links when the uploadObjectToDelete
object is null
. This is probably the best option.
<f:if condition="uploadObjectToDelete">
<f:link.action action="delete" arguments="{upload:uploadObjectToDelete}" > ...
</f:if>
Option 2
Change your delete action to accept null
arguments:
public function deleteAction(Tx_MyExt_Domain_Model_Upload $upload = null) { ...
But this option doesn't make sense. Why would you allow your user to try and delete an object that is already null?
These are just suggestions.