Skip to content

Commit

Permalink
fix: edge case when lineText is null
Browse files Browse the repository at this point in the history
  • Loading branch information
devvaannsh committed Dec 7, 2024
1 parent c338330 commit f637fcb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/extensionsIntegrated/CSSColorPreview/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,12 @@ define(function (require, exports, module) {
*/
function detectValidColorsInLine(editor, lineNumber) {
const lineText = editor.getLine(lineNumber);

// to make sure that code doesn't break when lineText is null.
if (!lineText) {
return [];
}

const valueRegex = /:[^;]*;/g;
const validColors = [];

Expand Down

0 comments on commit f637fcb

Please sign in to comment.