input: Write a function to correct any issues in the following Python code which is intended to sum the elements of a list and return the result. If the code is already correct, return the code unchanged. If the given input is empty or incorrect, return None.
  assert sum_list([1, 2, 3, 4])==10
  assert sum_list([-1, -2, -3, -4])==-10
  assert sum_list([0, 0, 0, 0])==0
  assert sum_list([])==None
  assert sum_list("not a list")==None
output: def sum_list(lst):
      if not isinstance(lst, list) or not lst:
          return None
      return sum(lst)