Make legacy method getTagsOnCommit null pointer safe

Initial test writing has exposed two different cases where the method
throws a null pointer exception rather than returning an empty list.
Still needs further investigation to understand expected and actual
behavior.