Commit 65c30a88 authored by Christian Hergert's avatar Christian Hergert

diagnostics: fix critical about NULL diagnostics

parent a891fe37
Pipeline #213952 passed with stages
in 41 minutes and 16 seconds
......@@ -4530,6 +4530,8 @@ ide_source_view_real_populate_popup (GtkTextView *text_view,
*/
if ((diagnostics = ide_buffer_get_diagnostics (IDE_BUFFER (buffer))))
{
g_assert (IDE_IS_DIAGNOSTICS (diagnostics));
line_diags = ide_diagnostics_get_diagnostics_at_line (diagnostics,
ide_buffer_get_file (IDE_BUFFER (buffer)),
gtk_text_iter_get_line (&iter));
......
......@@ -64,11 +64,13 @@ gbp_editor_hover_provider_hover_async (IdeHoverProvider *provider,
IdeDiagnostics *diagnostics;
g_autoptr(GPtrArray) line_diags = NULL;
diagnostics = ide_buffer_get_diagnostics (IDE_BUFFER (buffer));
line_diags = ide_diagnostics_get_diagnostics_at_line (diagnostics, file, line);
IDE_PTR_ARRAY_SET_FREE_FUNC (line_diags, g_object_unref);
if ((diagnostics = ide_buffer_get_diagnostics (IDE_BUFFER (buffer))))
{
line_diags = ide_diagnostics_get_diagnostics_at_line (diagnostics, file, line);
IDE_PTR_ARRAY_SET_FREE_FUNC (line_diags, g_object_unref);
}
if (diagnostics && line_diags)
if (diagnostics != NULL && line_diags != NULL)
{
for (guint i = 0; i < line_diags->len; i++)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment