File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
src/main/kotlin/com/emberjs/utils Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -150,12 +150,14 @@ class EmberUtils {
150150 val r = ref as PsiElement ? ? : exp
151151
152152 if (r is JSVariable ) {
153- val v = r.children[1 ]
154- val viewProvider = file.containingFile.viewProvider
155- val ts = viewProvider.findElementAt(v.textOffset, JavaScriptSupportLoader .TYPESCRIPT )
156- val js = viewProvider.findElementAt(v.textOffset, JavaScriptSupportLoader .ECMA_SCRIPT_6 )
157- if (ts is OuterLanguageElement || js is OuterLanguageElement ) {
158- return r
153+ val v = r.children.getOrNull(1 )
154+ if (v != null ) {
155+ val viewProvider = file.containingFile.viewProvider
156+ val ts = viewProvider.findElementAt(v.textOffset, JavaScriptSupportLoader .TYPESCRIPT )
157+ val js = viewProvider.findElementAt(v.textOffset, JavaScriptSupportLoader .ECMA_SCRIPT_6 )
158+ if (ts is OuterLanguageElement || js is OuterLanguageElement ) {
159+ return r
160+ }
159161 }
160162 }
161163
You can’t perform that action at this time.
0 commit comments