From ef4b0ce023eb700b603986366fbf501e227aa0b6 Mon Sep 17 00:00:00 2001 From: lethliel Date: Tue, 2 Jul 2019 09:36:05 +0200 Subject: [PATCH] fix handling of empty prjconfig meta if prjconfig meta is empty the class metafile init fails with if isinstance(input[0], str): IndexError: list index out of range This is because input is an empty list and has no [0] index. This can be fixed by changing this line to: if input and isinstance(input[0], str): --- osc/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osc/core.py b/osc/core.py index 73d7e966..22125891 100644 --- a/osc/core.py +++ b/osc/core.py @@ -3666,7 +3666,7 @@ class metafile: if not isinstance(input, list): input = [input] - if isinstance(input[0], str): + if input and isinstance(input[0], str): input_as_str = ''.join(input) else: open_mode = 'wb'