We need line 1254, otherwise 'pipeline.close;' gets appended even if there is no pipeline client. I found that the extra condition on the removed line 1251 is unnecessary because flushData.data is always empty when js is disabled or the client is disabled. In those scenarios, there is never flushing so flushData.data never gets serialized tasks, and so remains empty.