avoid possible NULL dereference (fdo#82777)

Change-Id: Ifec915d5b2c9e5f7558e7850eb44e44300c9b374