Skip to content

Fix crash when a symbol is a path without a `d` attribute

This fixes a crash reported in the Symbols dialog, in particular when opening a document containing a symbol in its defs that contains a single path without the d attribute. There appear to be many duplicate issues but apparently they all share the same backlog.

When the symbol was empty, the function drawSymbol() used to create a C++ wrapper around a null pointer to a Cairo surface. Thus, the returned Cairo smart pointer pointed at a valid wrapper (passing a null-check), but the wrapper stored a null pointer to the underlying C structure. Further complicating things was the fact that a null return value fram draw_symbol() (that's a different function) was not handled in get_cell_data_func().

Fixes #4509 (closed)

Edited by Rafał Siejakowski

Merge request reports