Fix latent error for OCCreateResourceWithHost.
It was crashed when OCCreateResource calls using invalid uri or
already used uri.
OCCreateResource can return OC_STACK_OK, OC_STACK_INVALID_PARAM,
OC_STACK_INVALID_URI and so on.
Currently, it checks only if the result is OC_STACK_ERROR.
But, there can be a case where the result is not OC_STACK_ERROR
but 'handle' is NULL. In this case with this conditional statement,
some exceptional errors could happen.
Therefore, it should be changed for the conditional statement to check
if the resource creation is successful as intended.
Change-Id: I9921b3bb7874b1dbf8b0fda5483471506da93882
Signed-off-by: HyunJun Kim <hyunjun2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/923
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>