fix tests
This commit is contained in:
parent
3c025e97a8
commit
bf6449f201
2 changed files with 8 additions and 7 deletions
|
@ -75,9 +75,9 @@ public class ProfileStore {
|
|||
if (store.has(profileName)) {
|
||||
profile = cachedObjects.get(profileName);
|
||||
if (profile == null) {
|
||||
if (store.has("units")) {
|
||||
String units = store.getString("units");
|
||||
profile = new Profile(store.getJSONObject(profileName), units);
|
||||
JSONObject profileObject = store.getJSONObject(profileName);
|
||||
if (profileObject!= null && profileObject.has("units")) {
|
||||
profile = new Profile(profileObject, profileObject.getString("units"));
|
||||
cachedObjects.put(profileName, profile);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,11 @@ object LocalProfilePlugin : PluginBase(PluginDescription()
|
|||
.shortName(R.string.localprofile_shortname)
|
||||
.description(R.string.description_profile_local)), ProfileInterface {
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
loadSettings()
|
||||
}
|
||||
|
||||
private val log = LoggerFactory.getLogger(L.PROFILE)
|
||||
|
||||
private var rawProfile: ProfileStore? = null
|
||||
|
@ -54,10 +59,6 @@ object LocalProfilePlugin : PluginBase(PluginDescription()
|
|||
internal var numOfProfiles = 0
|
||||
internal var currentProfileIndex = 0
|
||||
|
||||
init {
|
||||
loadSettings()
|
||||
}
|
||||
|
||||
fun currentProfile() = profiles[currentProfileIndex]
|
||||
|
||||
@Synchronized
|
||||
|
|
Loading…
Reference in a new issue