fixes nullref due to build errors in the merged pull request #350

I've verified that this works for subtree add, pull, and checkintool without errors.