libsysprof: avoid some GError creation

This commit is contained in:
Christian Hergert
2023-08-29 13:40:06 -07:00
parent 9839d18238
commit 6ed1317012

View File

@ -490,10 +490,11 @@ sysprof_elf_loader_load (SysprofElfLoader *self,
}
failure:
g_set_error_literal (error,
G_FILE_ERROR,
G_FILE_ERROR_NOENT,
"Failed to locate file");
if (error != NULL)
g_set_error_literal (error,
G_FILE_ERROR,
G_FILE_ERROR_NOENT,
"Failed to locate file");
return NULL;
}