From 947cbb3e69a23cc9a18d3c430181f67bf726ae59 Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Fri, 27 Feb 2009 22:09:20 +0000
Subject: [PATCH] Avoid abort if there is a plugstack configured, but no
 options get propagated through the environment.

---
 src/common/plugstack.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/common/plugstack.c b/src/common/plugstack.c
index 47e4b6311cb..53f437365ee 100644
--- a/src/common/plugstack.c
+++ b/src/common/plugstack.c
@@ -1298,8 +1298,12 @@ int spank_get_remote_options_env (char **env)
 	char var [1024];
 	const char *arg;
 	struct spank_plugin_opt *option;
+	ListIterator i;
+
+	if (!option_cache)
+		return (0);
 
-	ListIterator i = list_iterator_create (option_cache);
+	i = list_iterator_create (option_cache);
 	while ((option = list_next (i))) {
 		struct spank_option *p = option->opt;
 
-- 
GitLab