Commit 82352b56 authored by Łukasz Nowak's avatar Łukasz Nowak

Protect against empty last_data

parent 9ed18944
...@@ -1049,6 +1049,8 @@ class SlapTool(BaseTool): ...@@ -1049,6 +1049,8 @@ class SlapTool(BaseTool):
hash='_'.join([software_instance_document.getRelativeUrl(), str(kw)]), hash='_'.join([software_instance_document.getRelativeUrl(), str(kw)]),
) )
last_data = self._getLastData(key) last_data = self._getLastData(key)
requested_software_instance = None
if last_data is not None and type(last_data) == type({}):
requested_software_instance = portal.restrictedTraverse( requested_software_instance = portal.restrictedTraverse(
last_data.get('request_instance'), None) last_data.get('request_instance'), None)
if last_data is None or type(last_data) != type(value) or \ if last_data is None or type(last_data) != type(value) or \
...@@ -1075,6 +1077,7 @@ class SlapTool(BaseTool): ...@@ -1075,6 +1077,7 @@ class SlapTool(BaseTool):
hash=str(kw) hash=str(kw)
) )
last_data = self._getLastData(key) last_data = self._getLastData(key)
if last_data is not None and type(last_data) == type({}):
requested_software_instance = portal.restrictedTraverse( requested_software_instance = portal.restrictedTraverse(
last_data.get('request_instance'), None) last_data.get('request_instance'), None)
if last_data is None or type(last_data) != type(value) or \ if last_data is None or type(last_data) != type(value) or \
......
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