Skip to content

Commit

Permalink
Return if ft is NULL
Browse files Browse the repository at this point in the history
Found by: scan-build
  • Loading branch information
rootkea committed Nov 25, 2021
1 parent 2dfb361 commit c6247aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/build.c
Expand Up @@ -448,9 +448,10 @@ gchar **build_get_regex(GeanyBuildGroup grp, GeanyFiletype *ft, guint *from)
GeanyDocument *doc = document_get_current();
if (doc != NULL)
ft = doc->file_type;
if (ft == NULL)
return NULL;
}
if (ft == NULL)
return NULL;

return_nonblank_regex(GEANY_BCS_PROJ, ft->priv->projerror_regex_string);
return_nonblank_regex(GEANY_BCS_HOME_FT, ft->priv->homeerror_regex_string);
return_nonblank_regex(GEANY_BCS_FT, ft->error_regex_string);
Expand Down
3 changes: 3 additions & 0 deletions src/filetypes.c
Expand Up @@ -1284,7 +1284,10 @@ gboolean filetypes_parse_error_message(GeanyFiletype *ft, const gchar *message,
doc = document_get_current();
if (doc != NULL)
ft = doc->file_type;
if (ft == NULL)
return FALSE;
}

tmp = build_get_regex(build_info.grp, ft, NULL);
if (tmp == NULL)
return FALSE;
Expand Down

0 comments on commit c6247aa

Please sign in to comment.