mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
safeguard cases where the CSW record output is erroneous
This commit is contained in:
parent
a41094d42e
commit
ada01603cb
@ -518,7 +518,13 @@ class MetaSearchDialog(QDialog, BASE_CLASS):
|
||||
return
|
||||
|
||||
identifier = get_item_data(item, 'identifier')
|
||||
record = self.catalog.records[identifier]
|
||||
try:
|
||||
record = self.catalog.records[identifier]
|
||||
except KeyError, err:
|
||||
QMessageBox.warning(self,
|
||||
self.tr('Record parsing error'),
|
||||
'Unable to locate record identifier')
|
||||
return
|
||||
|
||||
# if the record has a bbox, show a footprint on the map
|
||||
if record.bbox is not None:
|
||||
@ -734,6 +740,12 @@ class MetaSearchDialog(QDialog, BASE_CLASS):
|
||||
QMessageBox.warning(self, self.tr('GetRecords error'),
|
||||
self.tr('Error getting response: %s') % err)
|
||||
return
|
||||
except KeyError, err:
|
||||
QMessageBox.warning(self,
|
||||
self.tr('Record parsing error'),
|
||||
'Unable to locate record identifier')
|
||||
QApplication.restoreOverrideCursor()
|
||||
return
|
||||
|
||||
QApplication.restoreOverrideCursor()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user