Initialize member variables in the constructor

Based on TortoiseSVN revision 25312

Signed-off-by: Sup Yut Sum <ch3cooli@gmail.com>
Use IsViewGood() to check the pointer first before accessing it

Based on TortoiseSVN revision 25314

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