trap null pointer error when generating axis ticks

see #15934687731998