Add one if statement to tell your parent node is null

You have all nodes of categories in _id_name[ ] when your root starts at 1. But if not, you sometimes find your parent is null because they are not preserved in _id_name[ ]. Some problem will happen.