1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-12 23:56:13 +01:00

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):
This commit is contained in:
lethliel 2019-07-02 09:36:05 +02:00
parent d516560d47
commit ef4b0ce023

View File

@ -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'