From 4a07e01b7d7c1f14b0266416cb28356500c8edf9 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 3 Jun 2019 22:07:38 +0200 Subject: [PATCH] fix NPE --- app/build.gradle | 9 +-------- .../tidepool/messages/OpenDatasetRequestMessage.kt | 5 +++-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 10df18e1ad..aa9af83075 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -279,16 +279,9 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - // xDrip-plus port + // new for tidepool implementation 'com.squareup.okhttp3:okhttp:3.10.0' implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0' - - // you will want to install the android studio lombok plugin - //compileOnly 'org.projectlombok:lombok:1.16.20' - // compileOnly 'javax.annotation:javax.annotation-api:1.3.2' - //annotationProcessor "org.projectlombok:lombok:1.16.20" - - // new for tidepool implementation "com.squareup.retrofit2:retrofit:2.4.0" implementation "com.squareup.retrofit2:adapter-rxjava2:2.3.0" implementation "com.squareup.retrofit2:converter-gson:2.4.0" diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/OpenDatasetRequestMessage.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/OpenDatasetRequestMessage.kt index cca39ff9c2..7cdd44fca2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/OpenDatasetRequestMessage.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/OpenDatasetRequestMessage.kt @@ -4,6 +4,7 @@ import com.google.gson.annotations.Expose import info.nightscout.androidaps.BuildConfig import info.nightscout.androidaps.interfaces.PluginBase import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin +import info.nightscout.androidaps.plugins.source.SourceNSClientPlugin import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.T import java.util.* @@ -26,9 +27,9 @@ class OpenDatasetRequestMessage : BaseMessage() { @Expose var dataSetType = UPLOAD_TYPE // omit for "normal" @Expose - var deviceManufacturers = arrayOf((ConfigBuilderPlugin.getPlugin().activeBgSource as PluginBase).name) + var deviceManufacturers = arrayOf(((ConfigBuilderPlugin.getPlugin().activeBgSource ?: SourceNSClientPlugin.getPlugin()) as PluginBase).name) @Expose - var deviceModel = (ConfigBuilderPlugin.getPlugin().activeBgSource as PluginBase).name + var deviceModel = arrayOf(((ConfigBuilderPlugin.getPlugin().activeBgSource ?: SourceNSClientPlugin.getPlugin()) as PluginBase).name) @Expose var deviceTags = arrayOf("bgm", "cgm", "insulin-pump") @Expose