Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Preventing runtime.channel() from throwing exceptions on missing implementations #1074

Merged
merged 1 commit into from
Nov 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.itangcent.annotation.script.ScriptTypeName
import com.itangcent.common.text.TemplateEvaluator
import com.itangcent.common.text.TemplateUtils
import com.itangcent.common.text.union
import com.itangcent.common.utils.safe
import com.itangcent.idea.plugin.api.export.ExportChannel
import com.itangcent.idea.plugin.utils.LocalStorage
import com.itangcent.idea.plugin.utils.RegexUtils
Expand Down Expand Up @@ -270,7 +271,9 @@ abstract class StandardJdkRuleParser : ScriptRuleParser() {
private val actionContext by lazy { ActionContext.getContext() }

fun channel(): String? {
return actionContext?.instance(ExportChannel::class)?.channel()
return safe {
actionContext?.instance(ExportChannel::class)?.channel()
}
}

fun projectName(): String? {
Expand Down
Loading