Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException when invoking isValidVpa method #82

Open
SelvaKumar92 opened this issue Nov 27, 2024 · 1 comment
Open

NullPointerException when invoking isValidVpa method #82

SelvaKumar92 opened this issue Nov 27, 2024 · 1 comment

Comments

@SelvaKumar92
Copy link

I encountered a NullPointerException when attempting to invoke the isValidVpa method in the Razorpay Flutter plugin. The error occurs when the method is called, resulting in the following stack trace:

E/MethodChannel#razorpay_flutter_customui(13392): Failed to handle method call
E/MethodChannel#razorpay_flutter_customui(13392): java.lang.NullPointerException: Attempt to invoke virtual method 'void com.razorpay.Razorpay.isValidVpa(java.lang.String, com.razorpay.ValidateVpaCallback)' on a null object reference
E/MethodChannel#razorpay_flutter_customui(13392): 	at com.razorpay.flutter_customui.RazorpayDelegate.isValidVpa(RazorpayDelegate.java:165)
E/MethodChannel#razorpay_flutter_customui(13392): 	at com.razorpay.flutter_customui.RazorpayPlugin.onMethodCall(RazorpayPlugin.java:103)
E/MethodChannel#razorpay_flutter_customui(13392): 	at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258)
E/MethodChannel#razorpay_flutter_customui(13392): 	at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#razorpay_flutter_customui(13392): 	at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/MethodChannel#razorpay_flutter_customui(13392): 	at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#razorpay_flutter_customui(13392): 	at android.os.Handler.handleCallback(Handler.java:883)
E/MethodChannel#razorpay_flutter_customui(13392): 	at android.os.Handler.dispatchMessage(Handler.java:100)
E/MethodChannel#razorpay_flutter_customui(13392): 	at android.os.Looper.loop(Looper.java:214)
E/MethodChannel#razorpay_flutter_customui(13392): 	at android.app.ActivityThread.main(ActivityThread.java:7682)
E/MethodChannel#razorpay_flutter_customui(13392): 	at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#razorpay_flutter_customui(13392): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
E/MethodChannel#razorpay_flutter_customui(13392): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
@vivekshindhe
Copy link
Contributor

@SelvaKumar92 You will need to trigger initilizeSdk("{razorpay_api_key}") function before calling isValidVpa().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants