Commit 4f89e04 Bhakta
committed
1 parent 030753a commit 4f89e04 Copy full SHA for 4f89e04
File tree 2 files changed +14
-2
lines changed
lib/commonAPI/coreapi/ext/shared
platform/android/Rhodes/jni/src
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,14 @@ namespace push {
37
37
// ----------------------------------------------------------------------------------------------------------------------
38
38
CPushManager* CPushManager::getInstance ()
39
39
{
40
- return reinterpret_cast <CPushManager*>(CPushFactoryBase::getInstance ()->getModuleSingleton ());
40
+ CPushFactoryBase* pInstance = CPushFactoryBase::getInstance ();
41
+ if (pInstance){
42
+ LOG (TRACE) + " Returning CPushManager Instance" ;
43
+ return reinterpret_cast <CPushManager*>(pInstance->getModuleSingleton ());
44
+ }else {
45
+ LOG (TRACE) + " CPushFactoryBase::getInstance is empty. Returning 0" ;
46
+ return 0 ;
47
+ }
41
48
}
42
49
43
50
// ----------------------------------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -332,7 +332,12 @@ RHO_GLOBAL void JNICALL Java_com_rhomobile_rhodes_RhodesService_setPushRegistrat
332
332
std::string strType = jType ? rho_cast<std::string>(env, jType) : " " ;
333
333
std::string deviceId = rho_cast<std::string>(env, jId);
334
334
335
- rho::push::CPushManager::getInstance ()->setDeviceId (strType, deviceId);
335
+ rho::push::CPushManager* pInstance = rho::push::CPushManager::getInstance ();
336
+ if (pInstance){
337
+ pInstance->setDeviceId (strType, deviceId);
338
+ }else {
339
+ RAWTRACE (" rho::push::CPushManager::getInstance is empty" );
340
+ }
336
341
}
337
342
338
343
RHO_GLOBAL jboolean JNICALL Java_com_rhomobile_rhodes_RhodesService_callPushCallback
You can’t perform that action at this time.
0 commit comments