}
}
+ const auto it_method = obj.find("method");
+ std::string method = "unknown";
+
+ if (obj.end() != it_method && it_method->second.is<std::string>()) {
+ method = it_method->second.get<std::string>();
+ }
+
PlatformResult status =
- SetEnum(alarm, _calendar_alarm.action, kAlarmMethod,
- common::FromJson<std::string>(obj, "method"));
+ SetEnum(alarm, _calendar_alarm.action, kAlarmMethod, method);
if (status.IsError()) {
LoggerE("Error: %s", status.message().c_str());
return status;
var _absoluteDate = time instanceof tizen.TZDate && !this.before ? time : null;
var _before = time instanceof tizen.TimeDuration && !this.absoluteDate ? time : null;
- var _method = converter_.toEnum(method, Object.keys(AlarmMethod), false);
var _description = (description) ? converter_.toString(description, true) : '';
+ var _method;
+
+ try {
+ _method = converter_.toEnum(method, Object.keys(AlarmMethod), false);
+ } catch (e) {
+ console.warn('Failed to convert method: "' + method + '" to enum AlarmMethod.');
+ _method = method;
+ }
Object.defineProperties(this, {
absoluteDate: {