bugfix for nil class

if nil class ,for example no master repository, rescue and create new repo.commit.