From b0c96ee9d0649726b2909fa5239eb0844015200a Mon Sep 17 00:00:00 2001 From: addshore Date: Mon, 16 Nov 2015 14:41:46 +0100 Subject: [PATCH] Dont backup null points --- GraphiteBackup.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/GraphiteBackup.php b/GraphiteBackup.php index 6a9ee6b..5aa327c 100644 --- a/GraphiteBackup.php +++ b/GraphiteBackup.php @@ -38,8 +38,11 @@ private function executeTargetInput( $targetInput ) { list( $value, $timestamp ) = $dataPoint; $stringToAdd = $timestamp . ' ' . $value . "\n"; - // Don't write the line if we already have an exact duplicate - if ( strpos( $currentFileContents, $stringToAdd ) !== false ) { + // Don't write the line if we already have an exact duplicate or it is null + if ( + $value == '' || + strpos( $currentFileContents, $stringToAdd ) !== false + ) { $dataPointsSkipped++; continue; }