[Fix #7877] Crash when saving layer style as qml