lib/gooddata/models/metadata/report_definition.rb in gooddata-0.6.4 vs lib/gooddata/models/metadata/report_definition.rb in gooddata-0.6.5
- old
+ new
@@ -146,14 +146,14 @@
# @return [GoodData::ReportDataResult]
def data_result(result)
data_result_uri = result['execResult']['dataResult']
result = GoodData.get data_result_uri
- while result['taskState'] && result['taskState']['status'] == 'WAIT'
+ while result && result['taskState'] && result['taskState']['status'] == 'WAIT'
sleep 10
result = GoodData.get data_result_uri
end
-
+ return nil unless result
ReportDataResult.new(GoodData.get data_result_uri)
end
def create(options = {})
left = Array(options[:left])