diff --git a/WpkgInstaller/WpkgInstaller.cs b/WpkgInstaller/WpkgInstaller.cs
index dcf38650256bc4a4495afd62fd0b294bfcf73962..7a663b28eb252ebef87aa57444ae2f3a30cc9f63 100755
--- a/WpkgInstaller/WpkgInstaller.cs
+++ b/WpkgInstaller/WpkgInstaller.cs
@@ -124,7 +124,7 @@ namespace WpkgInstaller
 
         private void WriteStdoutToLog(object sendingProcess, DataReceivedEventArgs e)
         {
-            if (e != null)
+            if (e != null && e.Data != null)
             {
                 eventLog.WriteEntry(e.Data, EventLogEntryType.Information);
             }
@@ -133,7 +133,7 @@ namespace WpkgInstaller
 
         private void WriteStderrToLog(object sendingProcess, DataReceivedEventArgs e)
         {
-            if (e != null)
+            if (e != null && e.Data != null)
             {
                 eventLog.WriteEntry(e.Data, EventLogEntryType.Error);
             }