Commit 797171f7 authored by Lauri Himanen's avatar Lauri Himanen

Fixed issue with CacheService trying to access the value of a non-existing CacheObject.

parent ab8abff7
......@@ -558,12 +558,17 @@ class CacheService(object):
"""Get the value identified by name. If the cachemode does not support
getting the value, an exception is raised.
name(string): The name of the cached object to return.
The requested object from the cache
cache_object = self.get_cache_object(name)
return cache_object.value
if cache_object is None:
return None
return cache_object.value
def get_cache_object(self, name):
......@@ -575,8 +580,7 @@ class CacheService(object):
def __setitem__(self, name, value):
"""Used to set the value for an item. The CacheObject corresponding to
the name has to be first created by using the function
the name has to be first dclared by using the function add().
cache_object = self._cache[name]
cache_object.value = value
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment