Implement koto_utils_is_valid_string to replace repetitive NULL and g_strcmp0 code.

Reduce usage of g_return_if_fail since it results in unnecessary warnings.
This commit is contained in:
Joshua Strobl 2021-05-07 21:52:42 +03:00
parent 0aafa68a35
commit b4ffba62c7
17 changed files with 121 additions and 65 deletions

View file

@ -20,6 +20,7 @@
#include "../../db/cartographer.h"
#include "../../indexer/structs.h"
#include "../../koto-track-item.h"
#include "../../koto-utils.h"
#include "disc-view.h"
extern KotoActionBar *action_bar;
@ -156,7 +157,7 @@ void koto_disc_view_handle_selected_rows_changed(GtkListBox *box, gpointer user_
gchar *album_uuid = koto_indexed_album_get_album_uuid(self->album); // Get the UUID
if ((album_uuid == NULL) || g_strcmp0(album_uuid, "") == 0) { // Not set
if (!koto_utils_is_string_valid(album_uuid)) { // Not set
return;
}