aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Richard Brown <rbrown@exherbo.org> 2008-01-11 20:13:38 +0000
committerAvatar Richard Brown <rbrown@exherbo.org> 2008-01-11 20:13:38 +0000
commitc55707b98b1834a0c4df72f8cc649ee854752958 (patch)
treec768e25c0ef525d1003739dcf649c433a5af551f
parent5e6f6e90079ab26d811d81e507f9211fb875a500 (diff)
downloadpaludis-c55707b98b1834a0c4df72f8cc649ee854752958.tar.gz
paludis-c55707b98b1834a0c4df72f8cc649ee854752958.tar.xz
(ruby) Fix segfault in env.set(non_existant_set)
-rw-r--r--ruby/environment.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/ruby/environment.cc b/ruby/environment.cc
index 7becc81..c2255d0 100644
--- a/ruby/environment.cc
+++ b/ruby/environment.cc
@@ -106,7 +106,12 @@ namespace
{
try
{
- return dep_tree_to_value<SetSpecTree>(value_to_environment(self)->set(SetName(StringValuePtr(set_name))));
+ SetName s(StringValuePtr(set_name));
+ tr1::shared_ptr<SetSpecTree::ConstItem> set = (value_to_environment(self)->set(s));
+ if (set)
+ return dep_tree_to_value<SetSpecTree>(set);
+ else
+ return Qnil;
}
catch (const std::exception & e)
{