Prevent .onmatch from being called if an assertion is generated in the dialog.

fixes #3170, #3463.