It depends on what you want to do with your JSON Output. If you still want it generated, but with an empty row to show there was no data, use the Detect Empty Stream step. You will have to have one stream for when there really is data from the table and another for generating an empty data set.
The alternative would be to use a filter rows step that only passes data to the JSON output step if it exists.