Fix the result variable not being initialized, again.
This commit is contained in:
		
							parent
							
								
									13898d9de0
								
							
						
					
					
						commit
						1c3981a81a
					
				@ -18,7 +18,7 @@ object Configuration {
 | 
				
			|||||||
    private val baseConf = ConfigFactory.parseString(base)
 | 
					    private val baseConf = ConfigFactory.parseString(base)
 | 
				
			||||||
    @JvmField
 | 
					    @JvmField
 | 
				
			||||||
    val obtained: Config = run {
 | 
					    val obtained: Config = run {
 | 
				
			||||||
        lateinit var result: Config
 | 
					        var result: Config = baseConf
 | 
				
			||||||
        with(file) {
 | 
					        with(file) {
 | 
				
			||||||
            if (!exists()) {
 | 
					            if (!exists()) {
 | 
				
			||||||
                createNewFile()
 | 
					                createNewFile()
 | 
				
			||||||
@ -27,7 +27,7 @@ object Configuration {
 | 
				
			|||||||
            } else result = try {
 | 
					            } else result = try {
 | 
				
			||||||
                ConfigFactory.parseFile(file)
 | 
					                ConfigFactory.parseFile(file)
 | 
				
			||||||
            } catch (e: ConfigException) {
 | 
					            } catch (e: ConfigException) {
 | 
				
			||||||
                Snowy.logs.warn("Could not parse the snowy configuration file, the default configuration will be used instead."); baseConf
 | 
					                Snowy.logs.warn("Could not parse the snowy configuration file, the default configuration will be used instead."); result
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        ConfigFactory.load(result).getConfig("Snowy").resolveWith(baseConf)
 | 
					        ConfigFactory.load(result).getConfig("Snowy").resolveWith(baseConf)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user