CASSANDRA-11534 there is a potential bug in this code:
It cannot be reproduced with any of our tests but there is a code path that could cause table_meta to be None when the statement cannot be parsed. Given that the code before 11534 used to check on table_meta not being None, I prefer to put back the same check in order to avoid any possible regressions once 3.10 is released. Also, since we check in all other places, this helps with consistency too.
The only reason we need the table metadata in that code block is to get the keyspace name. We should fallback to the current keyspace name if we have no table metadata.