Wrap the body in { }

    if (tableOpt.isEmpty) {
      throwMissingTableException()
    }

also do it for the other place that calls throwMissingTableException