Skip to content

Commit

Permalink
Spare unused variable
Browse files Browse the repository at this point in the history
  • Loading branch information
v-p-b authored and dnet committed Jun 22, 2022
1 parent b949f5d commit 0e72ed5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main/kotlin/burp/BurpExtender.kt
Original file line number Diff line number Diff line change
Expand Up @@ -578,9 +578,8 @@ class BurpExtender : IBurpExtender, ITab, ListDataListener, IHttpListener {
}

private fun loadConfig(): Piper.Config {
val serialized = callbacks.loadExtensionSetting(EXTENSION_SETTINGS_KEY)
val env = System.getenv(CONFIG_ENV_VAR)
try {
val env = System.getenv(CONFIG_ENV_VAR)
if (env != null) {
val fmt = if (env.endsWith(".yml") || env.endsWith(".yaml")){
ConfigFormat.YAML
Expand All @@ -589,11 +588,14 @@ class BurpExtender : IBurpExtender, ITab, ListDataListener, IHttpListener {
}
val configFile = File(env)
return fmt.parse(configFile.readBytes()).updateEnabled(true)
} else if (serialized != null) {
}

val serialized = callbacks.loadExtensionSetting(EXTENSION_SETTINGS_KEY)
if (serialized != null) {
return Piper.Config.parseFrom(decompress(unpad4(Z85.Z85Decoder(serialized))))
} else {
throw Exception("Fallback to default config")
}

throw Exception("Fallback to default config")
} catch (e: Exception) {
val cfgMod = loadDefaultConfig()
saveConfig(cfgMod)
Expand Down

0 comments on commit 0e72ed5

Please sign in to comment.