Changeset 84ab7b4 in sasview


Ignore:
Timestamp:
Jul 11, 2016 2:20:49 AM (8 years ago)
Author:
lewis
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
970df0f
Parents:
97db3e9
Message:

Fix bug when loading saved project with no output saved

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/corfunc/corfunc_state.py

    r9f876a5 r84ab7b4  
    22import sys 
    33import os 
     4import logging 
    45import sas.sascalc.dataloader 
    56from lxml import etree 
     
    161162 
    162163        # Output parameters 
    163         output = new_doc.createElement("output") 
    164         top_element.appendChild(output) 
    165         for item in output_list: 
    166             element = new_doc.createElement(item[0]) 
    167             element.appendChild(new_doc.createTextNode(self.outputs[item[0]])) 
    168             output.appendChild(element) 
     164        if self.outputs != {} and self.outputs is not None: 
     165            output = new_doc.createElement("output") 
     166            top_element.appendChild(output) 
     167            for item in output_list: 
     168                element = new_doc.createElement(item[0]) 
     169                element.appendChild(new_doc.createTextNode(self.outputs[item[0]])) 
     170                output.appendChild(element) 
    169171 
    170172        # Save the file or return the original document with the state 
Note: See TracChangeset for help on using the changeset viewer.