Fix #4307 - Check action for nil

Auxiiary modules already do this, but looks like we forgot to do the
same for post modules.

I also changed the error to allow "reason" in order to be more
informative about what the user should do.

Fix #4307
Remove junk code
Land #4319, @wchen-r7's fix for #4307