Fix NPE in the LwM2MClientOtaInfo

This commit is contained in:
Andrii Shvaika 2021-06-25 12:18:50 +03:00
parent 5bff4d1a6b
commit b93a397a23

View File

@ -56,7 +56,7 @@ public class LwM2MClientOtaInfo {
public LwM2MClientOtaInfo(String endpoint, OtaPackageType type, Integer strategyCode, String baseUrl) {
this.endpoint = endpoint;
this.type = type;
this.fwStrategy = LwM2MFirmwareUpdateStrategy.fromStrategyFwByCode(strategyCode);
this.fwStrategy = strategyCode != null ? LwM2MFirmwareUpdateStrategy.fromStrategyFwByCode(strategyCode) : LwM2MFirmwareUpdateStrategy.OBJ_5_BINARY;
this.baseUrl = baseUrl;
}