Skip to content

Commit f637fcb

Browse files
committed
fix: edge case when lineText is null
1 parent c338330 commit f637fcb

File tree

1 file changed

+6
-0
lines changed
  • src/extensionsIntegrated/CSSColorPreview

1 file changed

+6
-0
lines changed

src/extensionsIntegrated/CSSColorPreview/main.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,12 @@ define(function (require, exports, module) {
266266
*/
267267
function detectValidColorsInLine(editor, lineNumber) {
268268
const lineText = editor.getLine(lineNumber);
269+
270+
// to make sure that code doesn't break when lineText is null.
271+
if (!lineText) {
272+
return [];
273+
}
274+
269275
const valueRegex = /:[^;]*;/g;
270276
const validColors = [];
271277

0 commit comments

Comments
 (0)