Add test for error == nil