From 8bb536cf4a95bfe32c47fe4d42fccd496a93e99d Mon Sep 17 00:00:00 2001
From: bakere1 <bakere1@student.unimelb.edu.au>
Date: Mon, 29 Mar 2021 14:14:52 +1100
Subject: [PATCH] Log Process finishes (half done) again

---
 allocate.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/allocate.c b/allocate.c
index d817f18..d10457f 100644
--- a/allocate.c
+++ b/allocate.c
@@ -172,8 +172,9 @@ int main(int argc, char *argv[]) {
                 exit(1);
             }
             //  Log finished processes.
-            struct node * currNode  = (struct node *) completedProcesses;
-            process * currProc = currNode->data;
+            struct node * currNode  = ((struct node *) completedProcesses);
+            process * currProc;
+            if (currNode) currProc = currNode->data;
             while ( currNode ){
                 if ( currProc->timeCompleted >= currentTime ) {
                     printf("%d,FINISHED,pid=%s,proc_remaining=%d\n",
-- 
GitLab