avoid "console==null" problems
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / actions / PHPStartApacheAction.java
index b1f00bd..4082d14 100644 (file)
@@ -97,7 +97,9 @@ public class PHPStartApacheAction implements IWorkbenchWindowActionDelegate {
     //    MessageDialog.openInformation(activeWindow.getShell(), "Exec command: ", command);
     try {
       PHPConsole console = PHPConsole.getInstance();
-      console.write(consoleMessage + command + "\n");
+      if (console!=null) {
+        console.write(consoleMessage + command + "\n");
+      }
       Runtime runtime = Runtime.getRuntime();
 
       // runs the command
@@ -110,7 +112,9 @@ public class PHPStartApacheAction implements IWorkbenchWindowActionDelegate {
       String consoleOutput = PHPConsole.getStringFromStream(stream);
 
       // prints out the information
-      console.write(consoleOutput);
+         if (console!=null) {
+        console.write(consoleOutput);
+         }
       return consoleOutput;
 
     } catch (IOException e) {