Ignore null entries

Not sure how or why they're there, but sure.
This commit is contained in:
Jake Howard 2020-03-10 08:33:54 +00:00
parent c2a13d4584
commit 5da10e58eb
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -27,6 +27,8 @@ def get_vscode_project_dirs():
vscode_config = json.loads(VSCODE_CONFIG_FILE.read_text()) vscode_config = json.loads(VSCODE_CONFIG_FILE.read_text())
for recent_path in itertools.chain(*vscode_config['openedPathsList'].values()): for recent_path in itertools.chain(*vscode_config['openedPathsList'].values()):
if not recent_path:
continue
recent_path_path = Path(recent_path.replace('file://', '')) recent_path_path = Path(recent_path.replace('file://', ''))
if recent_path_path.exists(): if recent_path_path.exists():
yield recent_path_path yield recent_path_path