https://bugs.documentfoundation.org/show_bug.cgi?id=171670

--- Comment #14 from Julien Nabet <[email protected]> ---
With this patch:
diff --git a/sc/source/core/data/documen9.cxx
b/sc/source/core/data/documen9.cxx
index 162ccc658bde..d45e7ab63684 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -255,7 +255,10 @@ IMPL_LINK( ScDocument, GetUserDefinedColor, sal_uInt16,
nColorIndex, Color* )
             pColorList = XColorList::CreateStdColorList();
         xColorList = pColorList;
     }
-    return
const_cast<Color*>(&(xColorList->GetColor(nColorIndex)->GetColor()));
+    if (auto color = xColorList->GetColor(nColorIndex))
+        return const_cast<Color*>(&(color->GetColor()));
+    else
+        return nullptr;
 }

 bool ScDocument::DrawGetPrintArea( ScRange& rRange, bool bSetHor, bool bSetVer
) const


it doesn't crash anymore but when viewing cell format again, [COLOR1] hasn't
been saved in custom number format.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to