tdf#145486: Prevented crash by not updating readOnly value
Change-Id: I88c2b8a9a05335a16154a23a541882a3ca6de3e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124555
Tested-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
diff --git a/include/unotools/VersionConfig.hxx b/include/unotools/VersionConfig.hxx
index 60b3a36..c3bdeea 100644
--- a/include/unotools/VersionConfig.hxx
+++ b/include/unotools/VersionConfig.hxx
@@ -31,7 +31,7 @@ static bool isProductVersionUpgraded(bool aUpdateVersion)
= sLastVersion.getToken(0, '.').toInt32() * 10 + sLastVersion.getToken(1, '.').toInt32();
if (iCurrent > iLast)
{
if (aUpdateVersion)
if (aUpdateVersion && !officecfg::Setup::Product::ooSetupLastVersion::isReadOnly())
{ //update lastversion
std::shared_ptr<comphelper::ConfigurationChanges> batch(
comphelper::ConfigurationChanges::create());