input: Write a function to generate an HTML table displaying information about the top 10 bestselling books in a specific genre from a given SQLite database. The function should return the HTML string representing the table.
  
  assert generate_html_table('books.db', 'Fantasy')=='''<table><tr><th>Title</th><th>Author</th><th>Genre</th><th>Sales</th></tr></table>'''
  assert generate_html_table('books.db', 'Mystery')=='''<table><tr><th>Title</th><th>Author</th><th>Genre</th><th>Sales</th></tr></table>'''
  assert generate_html_table('nonexistent.db', 'Fantasy')==None
  assert generate_html_table('books.db', '')==None
output: def generate_html_table(db_path, genre):
      import sqlite3
      try:
          conn = sqlite3.connect(db_path)
          cursor = conn.cursor()
          cursor.execute("SELECT Title, Author, Genre, Sales FROM books WHERE Genre=? ORDER BY Sales DESC LIMIT 10", (genre,))
          rows = cursor.fetchall()
          conn.close()
          if not rows:
              return None
          html = '<table><tr><th>Title</th><th>Author</th><th>Genre</th><th>Sales</th></tr>'
          for row in rows:
              html += f'<tr><td>{row[0]}</td><td>{row[1]}</td><td>{row[2]}</td><td>{row[3]}</td></tr>'
          html += '</table>'
          return html
      except sqlite3.OperationalError:
          return None