The prayer is valid but  he will be sinful for his deed.

If a person is praying, but he has an intention in his mind that he will do a major sin afterwards, is his prayer nullified?

Sins |