Skip to content

Commit

Permalink
safeguard cases where the CSW record output is erroneous
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Feb 26, 2015
1 parent a41094d commit ada0160
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion python/plugins/MetaSearch/dialogs/maindialog.py
Expand Up @@ -518,7 +518,13 @@ def record_clicked(self):
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:
Expand Down Expand Up @@ -734,6 +740,12 @@ def show_metadata(self):
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()

Expand Down

0 comments on commit ada0160

Please sign in to comment.