Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
PHPirates committed Dec 27, 2024
1 parent 5a25459 commit 1b269be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nl/hannahsten/texifyidea/util/labels/LabelExtraction.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fun PsiElement.extractLabelElement(): PsiElement? {
}
else {
// Check for user defined environments
val labelPositions = EnvironmentManager.labelAliasesInfo.get(getEnvironmentName())
val labelPositions = EnvironmentManager.labelAliasesInfo.getOrDefault(getEnvironmentName(), null)
if (labelPositions != null) {
this.beginCommand.parameterList.getOrNull(labelPositions.positions.first())?.firstChildOfType(LatexParameterText::class)
}
Expand Down Expand Up @@ -98,7 +98,7 @@ fun PsiElement.extractLabelName(referencingFileSetCommands: Collection<LatexComm
is LatexEnvironment -> {
this.getLabel()
// Check if it is a user defined alias of a labeled environment
?: EnvironmentManager.labelAliasesInfo.get(getEnvironmentName())?.let {
?: EnvironmentManager.labelAliasesInfo.getOrDefault(getEnvironmentName(), null)?.let {
this.beginCommand.parameterList.getOrNull(it.positions.first())?.firstChildOfType(LatexParameterText::class)?.text
}
?: ""
Expand Down

0 comments on commit 1b269be

Please sign in to comment.