Added null check and only remembering commits with builds