Fix crash when clicking merge after switch

Fix regression of 4bb67cdf35c373a8b7007a6fed9b64e04b8e57e4

Signed-off-by: Sup Yut Sum <ch3cooli@gmail.com>