return resourceObj;
}
- catch (const PlatformException& e)
+ catch (const RCSPlatformException& e)
{
LOGE("%s", e.what());
throwPlatformException(env, e);
return valueObj;
}
- catch(const InvalidKeyException& e)
+ catch(const RCSInvalidKeyException& e)
{
return nullptr;
}
auto res = getResource(env, obj);
VERIFY_NO_EXC(env);
- res->setGetRequestHandler(std::bind(onGetRequest, std::placeholders::_1, std::placeholders::_2,
- JavaGlobalRef{ env, listenerObj }));
+ if (listenerObj)
+ {
+ res->setGetRequestHandler(std::bind(onGetRequest, std::placeholders::_1, std::placeholders::_2,
+ JavaGlobalRef{ env, listenerObj }));
+ }
+ else
+ {
+ res->setGetRequestHandler({ });
+ }
}
JNIEXPORT void JNICALL
auto res = getResource(env, obj);
VERIFY_NO_EXC(env);
- res->setSetRequestHandler(std::bind(onSetRequest, std::placeholders::_1, std::placeholders::_2,
- JavaGlobalRef{ env, listenerObj }));
+ if (listenerObj)
+ {
+ res->setSetRequestHandler(std::bind(onSetRequest, std::placeholders::_1,
+ std::placeholders::_2, JavaGlobalRef{ env, listenerObj }));
+ }
+ else
+ {
+ res->setSetRequestHandler({ });
+ }
}
JNIEXPORT void JNICALL
{
res->notify();
}
- catch (const PlatformException& e) {
+ catch (const RCSPlatformException& e) {
throwPlatformException(env, e);
}
}