diff --git a/src/com/googlecode/jmxtrans/model/output/GraphiteWriter.java b/src/com/googlecode/jmxtrans/model/output/GraphiteWriter.java
index <HASH>..<HASH> 100644
--- a/src/com/googlecode/jmxtrans/model/output/GraphiteWriter.java
+++ b/src/com/googlecode/jmxtrans/model/output/GraphiteWriter.java
@@ -101,6 +101,7 @@ public class GraphiteWriter extends BaseOutputWriter {
 									+ result.getEpoch() / 1000 + "\n";
 							log.debug("Graphite Message: {}", line);
 							writer.write(line);
+							writer.flush();
 						} else {
 							log.warn("Unable to submit non-numeric value to Graphite: [{}] from result [{}]", value, result);
 						}
@@ -108,7 +109,7 @@ public class GraphiteWriter extends BaseOutputWriter {
 				}
 			}
 		} finally {
-			if (writer.checkError()) {
+			if (writer != null && writer.checkError()) {
 				log.error("Error writing to Graphite, clearing Graphite socket pool");
 				pool.invalidateObject(address, socket);
 			} else {
Adding flush() back after write and ensuring writer exists