Bug : https://jira.iotivity.org/browse/IOT-2141
Change-Id: I6a77b388b401d9ee5364e9de2859e1c91978fca5
Signed-off-by: Jay Sharma <jay.sharma@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19447
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
private Item mGetCachedAttribute = new Item("8. Get Cached Attribute") {
@Override
public void execute() throws RcsException {
- printLog(ATTR_KEY_TEMPERATURE + " : " + mResourceObj
- .getCachedAttribute(ATTR_KEY_TEMPERATURE).asInt());
+ RcsValue value = mResourceObj.getCachedAttribute(ATTR_KEY_TEMPERATURE);
+ if (null != value) {
+ printLog(ATTR_KEY_TEMPERATURE + " : " + value.asInt());
+ } else {
+ printLog("Cache data is not available");
+ }
}
};