Skip to content

Commit

Permalink
fix: empty list default
Browse files Browse the repository at this point in the history
  • Loading branch information
MC-XiaoHei committed Jun 23, 2024
1 parent 322832c commit b6d28f1
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ class ProjectStoreService(private val project: Project) {
val patchesInfo: MutableMap<PatchType, PatchesInfo> = mutableMapOf()
val properties = Properties()
val configPath: Path = Paths.get(project.guessProjectDir()?.path ?: ".", LEAVESKNIFE_CONFIG_FILE)
val patchesList = mutableMapOf<PatchType,MutableList<String>>()
val patchesList = mutableMapOf<PatchType,MutableList<String>>(
PatchType.SERVER to mutableListOf(),
PatchType.API to mutableListOf(),
PatchType.GENERATED_API to mutableListOf()
)

private fun onEnable() {
println("Enabling plugin")
Expand All @@ -47,7 +51,6 @@ class ProjectStoreService(private val project: Project) {
status = PluginStatus.BROKEN_CONFIG
return
}
patchesList[patchType] = mutableListOf()
patchesDir.list()?.forEach {
patchesList[patchType]?.add(it)
}
Expand Down

0 comments on commit b6d28f1

Please sign in to comment.