aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-01-11 21:07:17 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-01-11 21:07:17 +0000
commitf6a69f30afa955641d96457f55af75bb91672441 (patch)
tree4902b4c889ac6a8c3072bfa2db0186f72c6ba838
parent9467b944b73c9b9f2033594ebe68f2669a5e9dbf (diff)
downloadpaludis-f6a69f30afa955641d96457f55af75bb91672441.tar.gz
paludis-f6a69f30afa955641d96457f55af75bb91672441.tar.xz
Don't asplode when trying to access a non-existant DepListOverrideMasksFunctions.
-rw-r--r--ruby/dep_list.cc2
-rw-r--r--ruby/dep_list_TEST.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/ruby/dep_list.cc b/ruby/dep_list.cc
index 4cb31ec..47e34da 100644
--- a/ruby/dep_list.cc
+++ b/ruby/dep_list.cc
@@ -796,7 +796,7 @@ namespace
{
tr1::shared_ptr<DepListOptions> * p;
Data_Get_Struct(self, tr1::shared_ptr<DepListOptions>, p);
- return dep_list_override_masks_functions_to_value((*p)->override_masks);
+ return (*p)->override_masks ? dep_list_override_masks_functions_to_value((*p)->override_masks) : Qnil;
}
/*
diff --git a/ruby/dep_list_TEST.rb b/ruby/dep_list_TEST.rb
index 4f197d3..363e4c5 100644
--- a/ruby/dep_list_TEST.rb
+++ b/ruby/dep_list_TEST.rb
@@ -149,7 +149,7 @@ module Paludis
default_options.each_pair do |method, value|
assert_respond_to options, method
if :override_masks == method
- assert_equal value.class, options.send(method).class
+ assert_nil options.send(method)
else
assert_equal value, options.send(method)
end