Description: Avoid panic when replStats.PreloadStats is nil.
Author: Steffen Prohaska <prohaska@zib.de>
Forwarded: https://github.com/dcu/mongodb_exporter/issues/110

Index: prometheus-mongodb-exporter/collector/metrics.go
===================================================================
--- prometheus-mongodb-exporter.orig/collector/metrics.go
+++ prometheus-mongodb-exporter/collector/metrics.go
@@ -349,7 +349,9 @@ func (replStats *ReplStats) Export(ch ch
 	replStats.Apply.Export(ch)
 	replStats.Buffer.Export(ch)
 	replStats.Network.Export(ch)
-	replStats.PreloadStats.Export(ch)
+	if replStats.PreloadStats != nil {
+		replStats.PreloadStats.Export(ch)
+	}
 }
 
 // PreloadStats are the stats associated with preload operation.
