Fix a null pointer exception when there is no last build