mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
Fix for random UI crash (#2840)
Co-authored-by: Opender Singh <opender94@gmail.com> Co-authored-by: Opender Singh <opender.singh@konghq.com>
This commit is contained in:
parent
cf047322a9
commit
e5a73190ee
@ -312,7 +312,13 @@ class CodeEditor extends React.Component {
|
||||
let startToken = '{';
|
||||
let endToken = '}';
|
||||
|
||||
// Prevent retrieving an invalid content if undefined
|
||||
if (!from?.line || !to?.line) return '\u2194';
|
||||
|
||||
const prevLine = this.codeMirror.getLine(from.line);
|
||||
|
||||
if (!prevLine) return '\u2194';
|
||||
|
||||
if (prevLine.lastIndexOf('[') > prevLine.lastIndexOf('{')) {
|
||||
startToken = '[';
|
||||
endToken = ']';
|
||||
|
Loading…
Reference in New Issue
Block a user