trivial: Make fu_common_version_parse_from_format() NULL-safe

This commit is contained in:
Richard Hughes 2022-01-01 16:31:05 +00:00
parent e17a107ce1
commit 0816151045

View File

@ -315,6 +315,10 @@ fu_common_version_parse_from_format(const gchar *version, FwupdVersionFormat fmt
guint64 tmp;
guint base;
/* sanity check */
if (version == NULL)
return NULL;
/* already dotted decimal */
if (g_strstr_len(version, -1, ".") != NULL)
return g_strdup(version);