This commit is contained in:
kunfei
2023-03-19 18:10:31 +08:00
parent df83e24074
commit 67dd0ce187
3 changed files with 6 additions and 6 deletions

View File

@@ -27,8 +27,8 @@ interface BaseBook : RuleDataInterface {
putVariable("custom", value)
}
fun getCustomVariable(): String? {
return getVariable("custom")
fun getCustomVariable(): String {
return getVariable("custom") ?: ""
}
override fun putBigVariable(key: String, value: String?) {

View File

@@ -196,8 +196,8 @@ interface BaseSource : JsExtensions {
/**
* 获取自定义变量
*/
fun getVariable(): String? {
return CacheManager.get("sourceVariable_${getKey()}")
fun getVariable(): String {
return CacheManager.get("sourceVariable_${getKey()}") ?: ""
}
/**

View File

@@ -24,8 +24,8 @@ interface RuleDataInterface {
fun putBigVariable(key: String, value: String?)
fun getVariable(key: String): String? {
return variableMap[key] ?: getBigVariable(key)
fun getVariable(key: String): String {
return variableMap[key] ?: getBigVariable(key) ?: ""
}
fun getBigVariable(key: String): String?