From f902e6b9c2bc4bc7009bb0cdd8354ec4e1f6c8ca Mon Sep 17 00:00:00 2001 From: "arya.k" Date: Wed, 2 Sep 2015 14:55:01 +0530 Subject: [PATCH] [Resource Encapsulation] Android unittest crash fix. Change-Id: I3a71aa30e7521c96a32bf5eb2de76a7189320525 Signed-off-by: arya.k Reviewed-on: https://gerrit.iotivity.org/gerrit/2349 Tested-by: jenkins-iotivity Reviewed-by: Jay Sharma Reviewed-by: Madan Lanka --- .../ResourceEncapsulation/client/RCSDiscoveryManager.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/service/resource-encapsulation/sdk/java/src/org/iotivity/ResourceEncapsulation/client/RCSDiscoveryManager.java b/service/resource-encapsulation/sdk/java/src/org/iotivity/ResourceEncapsulation/client/RCSDiscoveryManager.java index cc87fc9..2899183 100644 --- a/service/resource-encapsulation/sdk/java/src/org/iotivity/ResourceEncapsulation/client/RCSDiscoveryManager.java +++ b/service/resource-encapsulation/sdk/java/src/org/iotivity/ResourceEncapsulation/client/RCSDiscoveryManager.java @@ -173,7 +173,18 @@ public class RCSDiscoveryManager { String resourceType) throws RCSException { Log.i(LOG_TAG, "discoverResource called"); + + if(null == address){ + Log.e(LOG_TAG, "Empty Address"); + throw (new RCSException("Empty Address")); + } String addr = address.getAddress(); + + if(null == relativeURI || "" == relativeURI){ + Log.e(LOG_TAG, "Empty URI"); + throw (new RCSException("Empty URI")); + } + DiscoveryType typeOfDiscovery = address.getTypeOfDiscovery(); this.discoverResource(addr, typeOfDiscovery.ordinal(), relativeURI, resourceType, m_discoverListener); -- 2.7.4