Should fix adding a blank topic problem.

This might be a bit dirty, but it gets rid of the problem where it throws an error if you have a blank topic name. This is because it referenced a variable which didn't exist in that scope.