Fix a Fatal Error when removing a topic.

Signed-off-by: Yoshi2889 <rick.2889@gmail.com>
Merge pull request #1897 from Yoshi2889/removecrashfix

Fix a Fatal Error when removing a topic.