fixes #3815 Null pointer Exception When try to add a Tag

fixed the null pointer when loading tags. Please check it.