Skip to content

Commit 259be43

Browse files
committed
修复空异常
1 parent dbf884c commit 259be43

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

EmmyLua-Common/src/main/java/com/tang/intellij/lua/editor/completion/LuaDocCompletionContributor.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ class LuaDocCompletionContributor : CompletionContributor() {
130130
val classType = classDef.type
131131
val ctx = SearchContext.get(classDef.project)
132132
classType.processMembers(ctx) { _, member ->
133-
if (member is LuaClassField)
134-
completionResultSet.addElement(LookupElementBuilder.create(member.name!!).withIcon(LuaIcons.CLASS_FIELD))
133+
if (member is LuaClassField && member.name != null)
134+
completionResultSet.addElement(LookupElementBuilder.create(member.name).withIcon(LuaIcons.CLASS_FIELD))
135135
Unit
136136
}
137137
}
@@ -147,7 +147,11 @@ class LuaDocCompletionContributor : CompletionContributor() {
147147
val classType = seeRefTag.classNameRef?.resolveType() as? ITyClass
148148
val ctx = SearchContext.get(seeRefTag.project)
149149
classType?.processMembers(ctx) { _, member ->
150-
completionResultSet.addElement(LookupElementBuilder.create(member.name!!).withIcon(LuaIcons.CLASS_FIELD))
150+
if(member.name != null) {
151+
completionResultSet.addElement(
152+
LookupElementBuilder.create(member.name!!).withIcon(LuaIcons.CLASS_FIELD)
153+
)
154+
}
151155
Unit
152156
}
153157
}

0 commit comments

Comments
 (0)