Flush only if data available
Created by: dominikwerder
Issue
- Closes DM-1261
Description of work
- Only attempt to flush if data is available
- Was not an actual bug, but triggered code analysis lint
- ... and with this update we don't do unnecessary work, too.