Index: trunk/sources/HeuristicLab.Hive.Server.Console/3.2/HiveServerManagementConsole.cs
===================================================================
--- trunk/sources/HeuristicLab.Hive.Server.Console/3.2/HiveServerManagementConsole.cs	(revision 2099)
+++ trunk/sources/HeuristicLab.Hive.Server.Console/3.2/HiveServerManagementConsole.cs	(revision 2109)
@@ -216,28 +216,4 @@
       changes.Clear();
 
-      //#region ClientInfo
-      //ResponseList<ClientInfo> clientInfoOld = clientInfo;
-      //clientInfo = ClientManager.GetAllClients();
-
-      //IDictionary<int, ClientInfo> clientInfoOldHelp;
-
-      //CloneList(clientInfoOld, out clientInfoOldHelp);
-
-      //GetDelta(clientInfoOld.List, clientInfoOldHelp);
-      //#endregion
-
-      #region Clients
-      //ResponseList<ClientGroup> clientsOld = clients;
-
-      // newClients = ClientManager.GetAllClientGroups();
-
-      //IDictionary<Guid, ClientGroup> clientsOldHelp;
-
-      //CloneList(clientsOld, out clientsOldHelp);
-
-      //GetDelta(clientsOld.List, clientsOldHelp);
-      //DetermineDelta();
-      #endregion
-
       #region Job
       ResponseList<Job> jobsOld = jobs;
@@ -259,9 +235,4 @@
 
       #endregion
-
-      foreach (Changes change in changes) {
-        System.Diagnostics.Debug.WriteLine(change.ID + " " + change.ChangeType);
-      }
-
     }
 
@@ -290,34 +261,37 @@
         jobGroup.Add(lvJobPending);
 
-        foreach (Job job in jobs.List) {
-          if (job.State == State.calculating) {
-            ListViewItem lvi = new ListViewItem(job.Id.ToString(), 1, lvJobCalculating);
-            lvi.Tag = job;
-            jobObjects.Add(lvi);
-
-            lvi.ToolTipText = (job.Percentage * 100) + "% of job calculated";
-          } else if (job.State == State.finished) {
-            ListViewItem lvi = new ListViewItem(job.Id.ToString(), 0, lvJobFinished);
-            lvi.Tag = job;
-            jobObjects.Add(lvi);
-            //lvJobControl.Items.Add(lvi);
-          } else if (job.State == State.offline) {
-            ListViewItem lvi = new ListViewItem(job.Id.ToString(), 2, lvJobPending);
-            lvi.Tag = job;
-            jobObjects.Add(lvi);
-          }
-        } // Jobs
-        lvJobControl.BeginUpdate();
-        foreach (ListViewItem lvi in jobObjects) {
-          lvJobControl.Items.Add(lvi);
-        }
-        // actualization
-        lvJobControl.Groups.Add(lvJobCalculating);
-        lvJobControl.Groups.Add(lvJobFinished);
-        lvJobControl.Groups.Add(lvJobPending);
-        lvJobControl.EndUpdate();
-
-        if (currentJob != null) {
-          JobClicked();
+        if (jobs != null && jobs.List != null) {
+
+          foreach (Job job in jobs.List) {
+            if (job.State == State.calculating) {
+              ListViewItem lvi = new ListViewItem(job.Id.ToString(), 1, lvJobCalculating);
+              lvi.Tag = job;
+              jobObjects.Add(lvi);
+
+              lvi.ToolTipText = (job.Percentage * 100) + "% of job calculated";
+            } else if (job.State == State.finished) {
+              ListViewItem lvi = new ListViewItem(job.Id.ToString(), 0, lvJobFinished);
+              lvi.Tag = job;
+              jobObjects.Add(lvi);
+              //lvJobControl.Items.Add(lvi);
+            } else if (job.State == State.offline || job.State == State.pending) {
+              ListViewItem lvi = new ListViewItem(job.Id.ToString(), 2, lvJobPending);
+              lvi.Tag = job;
+              jobObjects.Add(lvi);
+            }
+          } // Jobs
+          lvJobControl.BeginUpdate();
+          foreach (ListViewItem lvi in jobObjects) {
+            lvJobControl.Items.Add(lvi);
+          }
+          // actualization
+          lvJobControl.Groups.Add(lvJobCalculating);
+          lvJobControl.Groups.Add(lvJobFinished);
+          lvJobControl.Groups.Add(lvJobPending);
+          lvJobControl.EndUpdate();
+
+          if (currentJob != null) {
+            JobClicked();
+          }
         }
       }
@@ -497,9 +471,11 @@
           ResponseObject<JobResult> jobRes = jobManager.GetLastJobResultOf(currentJob.Id);
 
-          lvi = null;
-          lvi = new ListViewItem();
-          lvi.Text = "Calculation ended:";
-          lvi.SubItems.Add(jobRes.Obj.DateFinished.ToString());
-          lvJobDetails.Items.Add(lvi);
+          if (jobRes != null && jobRes.Obj != null) {
+            lvi = null;
+            lvi = new ListViewItem();
+            lvi.Text = "Calculation ended:";
+            lvi.SubItems.Add(jobRes.Obj.DateFinished.ToString());
+            lvJobDetails.Items.Add(lvi);
+          }
         }
       }
@@ -554,7 +530,9 @@
               if (job.Id == change.ID) {
                 lvJobControl.Items[i].Tag = job;
-                if (currentJob.Id == change.ID) {
-                  currentJob = job;
-                  JobClicked();
+                if (currentJob != null) {
+                  if (currentJob.Id == change.ID) {
+                    currentJob = job;
+                    JobClicked();
+                  }
                 }
                 break;
@@ -562,18 +540,13 @@
             }
             State state = jobs.List[change.Position].State;
-            System.Diagnostics.Debug.WriteLine(lvJobControl.Items[i].Text.ToString());
             if (state == State.finished) {
               lvJobControl.Items[i].Group = jobGroup[1];
               lvJobControl.Items[i].ImageIndex = 0;
-              System.Diagnostics.Debug.WriteLine("finished");
             } else if (state == State.calculating) {
               lvJobControl.Items[i].Group = jobGroup[0];
               lvJobControl.Items[i].ImageIndex = 1;
-              System.Diagnostics.Debug.WriteLine("calculating");
-            } else if (state == State.offline) {
+            } else if (state == State.offline || state == State.pending) {
               lvJobControl.Items[i].Group = jobGroup[2];
               lvJobControl.Items[i].ImageIndex = 2;
-              System.Diagnostics.Debug.WriteLine("offline");
-
             }
             lvJobControl.Refresh();
@@ -813,5 +786,4 @@
       if (noCores > 0) {
         int capacity = ((noCores - freeCores) / noCores) * 100;
-        System.Diagnostics.Debug.WriteLine(capacity);
         return capacity;
       }
@@ -862,5 +834,4 @@
         if (found == false) {
           changes.Add(new Changes { Types = Type.Job, ID = job.Id, ChangeType = Change.Create });
-          System.Diagnostics.Debug.WriteLine("new Job: " + job.Id);
         }
         found = false;
@@ -868,5 +839,4 @@
       foreach (KeyValuePair<int, Job> kvp in helpJobs) {
         changes.Add(new Changes { Types = Type.Job, ID = kvp.Value.Id, ChangeType = Change.Delete, Position = kvp.Key });
-        System.Diagnostics.Debug.WriteLine("delete Job: " + kvp.Value.Id);
       }
     }
