From d93565423ae7ef9d8ebf4422c86d5dcf965d73ff Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 16 Jan 2018 11:30:27 -0600 Subject: [PATCH] Null guard auto-prefixing of '.' to scopes for backward compatibility In some cases, packages such as atom-beautify manually construct scope descriptors with an empty scopes array. --- src/scope-descriptor.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scope-descriptor.coffee b/src/scope-descriptor.coffee index 2085bd6b2..3990d12a8 100644 --- a/src/scope-descriptor.coffee +++ b/src/scope-descriptor.coffee @@ -41,7 +41,7 @@ class ScopeDescriptor getScopeChain: -> # For backward compatibility, prefix TextMate-style scope names with # leading dots (e.g. 'source.js' -> '.source.js'). - if @scopes[0].includes('.') + if @scopes[0]?.includes('.') result = '' for scope, i in @scopes result += ' ' if i > 0