Avoid real * string calling get_value() on an empty name

This happens on current master and it's harmless there (but it doesn't
do anything useful). Now, passing an empty string to get_value() hits
a context-related assertion. Since getting the value of an empty name
is always going to return None, skip the call in this case. Add a test
to catch this in future.