mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 01:37:51 -06:00
Return None if config file wasn't correct
This was actually specified in the original function description. Contributes to issue CURA-844.
This commit is contained in:
parent
0d553c10f1
commit
724f9ce010
2 changed files with 8 additions and 2 deletions
|
@ -12,7 +12,10 @@ import io #To write config files to strings as if they were files.
|
|||
# \param serialised The serialised form of a profile in version 1.
|
||||
# \return A profile instance, or None if the file format is incorrect.
|
||||
def importVersion1(serialised):
|
||||
return Profile(serialised)
|
||||
try:
|
||||
return Profile(serialised)
|
||||
except configparser.Error, SettingsError.InvalidFormatError, SettingsError.InvalidVersionError:
|
||||
return None
|
||||
|
||||
## A representation of a profile used as intermediary form for conversion from
|
||||
# one format to the other.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue