Fix the controller test error due to null object