Fixes string index error.

This commit is contained in:
Anton Hvornum 2021-05-14 16:13:03 +02:00
parent 4ff35663b8
commit 1674b7088d
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ def list_profiles(filter_irrelevant_macs=True, subpath='', filter_top_level_prof
description = ''
with open(os.path.join(root, file), 'r') as fh:
first_line = fh.readline()
if first_line[0] == '#':
if len(first_line) and first_line[0] == '#':
description = first_line[1:].strip()
cache[file[:-3]] = {'path' : os.path.join(root, file), 'description' : description, 'tailored' : tailored}