If libgvc was not built properly or is running against incorrectly versioned
plugins, gvRenderData() can fail and return a null string. Ensure libvaladoc
handles this correctly.
https://bugzilla.gnome.org/show_bug.cgi?id=711590
context.render (graph, file_type, file);
}
- public uint8[] write_buffer (string file_type) {
+ public uint8[]? write_buffer (string file_type) {
if (context == null) {
context = factory.create_context (graph);
}
- uint8[] data;
+ uint8[]? data;
+ /* This will return null in data if it fails. */
context.render_data (graph, file_type, out data);
return data;
}
}
public MarkupWriter add_usemap (Charts.Chart chart) {
- string buf = (string) chart.write_buffer ("cmapx");
- raw_text ("\n");
- raw_text (buf);
+ string? buf = (string?) chart.write_buffer ("cmapx");
+ if (buf != null) {
+ raw_text ("\n");
+ raw_text ((!) buf);
+ }
return this;
}