From bc5a5a5b45052ba99e56a75f4d22a87df7222bd1 Mon Sep 17 00:00:00 2001 From: Murtuza Zabuawala Date: Mon, 18 Sep 2017 11:55:04 +0100 Subject: [PATCH] Fix error message regexp in the query tool that could fail in some cases. Fixes #2700 --- .../static/jsx/history/detail/history_error_message.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/pgadmin/static/jsx/history/detail/history_error_message.jsx b/web/pgadmin/static/jsx/history/detail/history_error_message.jsx index 0b5e27bf1..af77a90ae 100644 --- a/web/pgadmin/static/jsx/history/detail/history_error_message.jsx +++ b/web/pgadmin/static/jsx/history/detail/history_error_message.jsx @@ -14,7 +14,9 @@ import Shapes from '../../react_shapes'; export default class HistoryErrorMessage extends React.Component { parseErrorMessage(message) { - return message.match(/ERROR:\s*([^\n\r]*)/i)[1]; + return message.match(/ERROR:\s*([^\n\r]*)/i) ? + message.match(/ERROR:\s*([^\n\r]*)/i)[1] : + message; } render() { @@ -27,4 +29,4 @@ export default class HistoryErrorMessage extends React.Component { HistoryErrorMessage.propTypes = { historyEntry: Shapes.historyDetail, -}; \ No newline at end of file +};