@bits-innovate/react-native-vstarcam 1.0.22 → 1.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -564,23 +564,32 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
564
564
 
565
565
  Log.d(TAG, "Calling JNIApi.login(" + clientInfo.sdkClientPtr + ", " + username + ", ***)");
566
566
 
567
+ boolean loginSuccess = false;
567
568
  try {
568
569
  loginMethod.invoke(null, clientInfo.sdkClientPtr, username, password);
569
570
  Log.d(TAG, "JNIApi.login returned normally");
571
+ loginSuccess = true;
570
572
  } catch (java.lang.reflect.InvocationTargetException ite) {
571
- Log.e(TAG, "JNIApi.login threw exception: " + ite.getCause(), ite.getCause());
572
- throw ite;
573
+ Throwable cause = ite.getCause();
574
+ Log.e(TAG, "JNIApi.login threw exception: " + cause, cause);
575
+ // Don't rethrow - return false instead to prevent crash
576
+ promise.resolve(false);
577
+ return;
573
578
  } catch (Throwable t) {
574
579
  Log.e(TAG, "JNIApi.login crashed: " + t.getMessage(), t);
575
- throw t;
580
+ // Don't rethrow - return false instead to prevent crash
581
+ promise.resolve(false);
582
+ return;
576
583
  }
577
584
 
578
- clientInfo.isLoggedIn = true;
579
- clientInfo.username = username;
580
- clientInfo.password = password;
581
- Log.d(TAG, "JNIApi.login called successfully");
585
+ if (loginSuccess) {
586
+ clientInfo.isLoggedIn = true;
587
+ clientInfo.username = username;
588
+ clientInfo.password = password;
589
+ }
582
590
 
583
- promise.resolve(true);
591
+ Log.d(TAG, "JNIApi.login completed with result: " + loginSuccess);
592
+ promise.resolve(loginSuccess);
584
593
  } catch (Exception e) {
585
594
  Log.e(TAG, "clientLogin failed", e);
586
595
  promise.reject("LOGIN_ERROR", e.getMessage());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bits-innovate/react-native-vstarcam",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "description": "React Native bridge for VStarCam P2P SDK",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",