int get_afhi_of_row(const struct osl_row *row, struct afh_info *afhi)
{
struct osl_object obj;
- int ret = osl(osl_get_object(audio_file_table, row, AFTCOL_AFHI,
- &obj));
+ int ret;
+
+ assert(row);
+ ret = osl(osl_get_object(audio_file_table, row, AFTCOL_AFHI, &obj));
if (ret < 0)
return ret;
load_afhi(obj.data, afhi);
/*
* These events are rare. We don't bother to check whether the
* current status items are affected and simply recreate them
- * every time.
+ * whenever an audio file is open.
*/
+ if (!current_aft_row)
+ return 0;
ret = get_afhi_of_row(current_aft_row,
&status_item_ls_data.afhi);
if (ret < 0)