create empty result if no data have been found

This commit is contained in:
seahawk1986 2018-09-03 11:11:48 +02:00 committed by GitHub
parent 468de0a2f3
commit 804f9f172f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -219,6 +219,7 @@ def collect_nvidia_data():
def output_data(data, write_edids=True):
result = {}
if data:
modes = []
for _, screen_data in data.items():
@ -230,7 +231,6 @@ def output_data(data, write_edids=True):
for refreshrate in refreshrates:
modes.append(Mode(connector, resolution, refreshrate))
if modes:
result = {}
try:
gpu_name, bus_id = collect_nvidia_data()
except ValueError: