Merge branch 'refs/heads/t/si_update'
[paraslash.git] / aft.c
diff --git a/aft.c b/aft.c
index 7a6d3f22e2361c42b5faca9d2ba240688215faec..6c07bcc2a13deb72985f7b87fb98c689c1c38a96 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -991,6 +991,8 @@ static int make_status_items(void)
        time_t current_time;
        int ret;
 
+       if (!status_item_ls_data.path) /* no audio file open */
+               return 0;
        ret = lls_parse(ARRAY_SIZE(argv), argv, cmd, &opts.lpr, NULL);
        assert(ret >= 0);
        time(&current_time);
@@ -2569,6 +2571,16 @@ static int aft_event_handler(enum afs_events event, struct para_buffer *pb,
                        return ret;
                make_status_items();
                return 1;
+       }
+       case BLOB_RENAME:
+       case BLOB_REMOVE:
+       case BLOB_ADD: {
+               /*
+                * These events are rare. We don't bother to check whether the
+                * current status items are affected and simply recreate them
+                * every time.
+                */
+               make_status_items();
        } default:
                return 0;
        }