It looks like usually you have name=tab['name'] if tab else...

Why not here?