Thomas Wouters you're right .. fetchall() don't return a None .. it return a weird result when it finds no record that match the search criteria .. it return [(None,)] .. you can't test for this using the usual "if list is None" .. you must test for this weird result like this:
if list[0][0] == None .. (this will return True)