def check_gameid(gid):
  """ Validate the game id to make sure it is not empty.

  Args:
    gid: The game id to check

  Returns:
    The game id.

  Raises:
    ValueError if the game id is the empty string or None.
  """
  if gid == "" or gid is None:
    raise ValueError('Bad Game Id: %s' % gid)
  return gid