Added a check for missing input table in tablescan

If for example a GetTable does not produce a table, this would just fail upon
requesting the input table's size
Throw invalid_argument for non-existent getTable