Code

list_window: don't invoke callback out-of-range
[ncmpc.git] / src / screen_text.c
index 4660f2851c06b90cbafb079c3a02e52da6a99969..a80b56240b09ecc18c22d21ce7b6ebf32ba4b175 100644 (file)
@@ -87,8 +87,7 @@ screen_text_list_callback(unsigned idx, G_GNUC_UNUSED bool *highlight,
        static char buffer[256];
        char *value;
 
-       if (idx >= text->lines->len)
-               return NULL;
+       assert(idx < text->lines->len);
 
        value = utf8_to_locale(g_ptr_array_index(text->lines, idx));
        g_strlcpy(buffer, value, sizeof(buffer));