The World Federation One Stop Fiqh

Ruling 1290

With regard to someone who has not travelled for a sinful purpose, if on the way he makes the intention of travelling the rest of the journey for a sinful purpose, he must perform tamām prayers. However, the prayers he performed in qaṣr form [before he changed his intention] are valid.