safeguard cases where the CSW record output is erroneous

This commit is contained in:
Tom Kralidis 2015-02-26 17:18:40 -05:00
parent a41094d42e
commit ada01603cb

View File

@ -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()