tui: don't call g_strv_length() on NULL

GLib-CRITICAL **: g_strv_length: assertion `str_array != NULL' failed
This commit is contained in:
Jiří Klimeš
2014-09-22 12:09:51 +02:00
parent efd09845c4
commit b0b51ec5ef

View File

@@ -172,7 +172,7 @@ nmt_address_list_add_clicked (NmtWidgetList *list)
NmtAddressListPrivate *priv = NMT_ADDRESS_LIST_GET_PRIVATE (list);
int len;
len = g_strv_length (priv->strings);
len = priv->strings ? g_strv_length (priv->strings) : 0;
priv->strings = g_renew (char *, priv->strings, len + 2);
priv->strings[len] = g_strdup ("");
priv->strings[len + 1] = NULL;