Skip to content

Commit e0acd90

Browse files
committed
only check connections XML if file can be parsed
1 parent c33c097 commit e0acd90

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

python/plugins/MetaSearch/util.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,16 @@ def get_connections_from_file(parent, filename):
8181
error = 0
8282
try:
8383
doc = etree.parse(filename).getroot()
84+
if doc.tag != 'qgsCSWConnections':
85+
error = 1
86+
msg = parent.tr('Invalid CSW connections XML.')
8487
except etree.ParseError, err:
8588
error = 1
8689
msg = parent.tr('Cannot parse XML file: %s' % err)
8790
except IOError, err:
8891
error = 1
8992
msg = parent.tr('Cannot open file: %s' % err)
9093

91-
if doc.tag != 'qgsCSWConnections':
92-
error = 1
93-
msg = parent.tr('Invalid CSW connections XML.')
94-
9594
if error == 1:
9695
QMessageBox.information(parent, parent.tr('Loading Connections'), msg)
9796
return

0 commit comments

Comments
 (0)