diff --git a/src/plugins/switch/cray/switch_cray.c b/src/plugins/switch/cray/switch_cray.c
index cbc9a1b51d579c478a7289233cffaffca559b4fc..3a44e26364216751f4aa30628a45be49b2f638c1 100644
--- a/src/plugins/switch/cray/switch_cray.c
+++ b/src/plugins/switch/cray/switch_cray.c
@@ -332,7 +332,7 @@ int switch_p_build_jobinfo(switch_jobinfo_t *switch_job,
 		error("(%s: %d: %s) list_str_to_array returned count %"
 		      PRIu32 "does not match expected count %d",
 		      THIS_FILE, __LINE__,
-		      __FUNCTION__, cnt, job->step_layout->node_cnt);
+		      __FUNCTION__, cnt, step_layout->node_cnt);
 	}
 
 	/*