Cobalt: NullPointerException - Cannot evaluate WhatsappWebSocket.toString()
This is the code
public static void main(String[] args) {
var api = new WhatsappAPI();
api.registerListener(new MyListener(api));
api.connect();
}
public class MyListener implements WhatsappListener {
private final WhatsappAPI api;
public MyListener(WhatsappAPI api){
this.api = api;
}
public void onLoggedIn(@NonNull UserInformationResponse info) {
System.out.println("Connected :)");
}
public void onChats(){
System.out.printf("Recived chats: %s%n", api.manager().chats());
}
}
And this is the error message:
Any ideas what I’m doing wrong?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (7 by maintainers)
use this code to print the qr to ur path
BufferedImage image = MatrixToImageWriter.toBufferedImage(qr); File outputfile = new File("image.jpg"); ImageIO.write(image, "jpg", outputfile);
Should be fixed in 2.2.2. Can you please double check?