fix indicator exception

When the indicator is none, there could be exception.
This patch could avoid this exception.

Change-Id: Ia243197ccab149a26f8bdf092b190c2c29c03ee5
This commit is contained in:
Yumeng Bao 2018-07-30 19:58:39 +08:00
parent 79fcf55752
commit 8193610532
1 changed files with 4 additions and 4 deletions

View File

@ -516,7 +516,7 @@ class EfficacyIndicator(base.APIDictWrapper):
def __init__(self, indicator):
super(EfficacyIndicator, self).__init__(indicator)
self.value = indicator.get('value', None)
self.name = indicator.get('name', None)
self.description = indicator.get('description', None)
self.unit = indicator.get('unit', None)
self.value = getattr(indicator, 'value', None)
self.name = getattr(indicator, 'name', None)
self.description = getattr(indicator, 'description', None)
self.unit = getattr(indicator, 'unit', None)