I am using java bot.can someone help on the registration tokens mentioned in the main class
docker run --env=RUNNER_IPV4=host.docker.internal java_bot .
Exception in thread “main” java.lang.NullPointerException
at java.base/java.util.UUID.fromString(Unknown Source)
at org.example.Main.main(Main.java:23)
Hey Smiley, I fixed the issue by changing the initialisation of the UUID token as follows:
String token_env_var = System.getenv(“Token”);
String reg_token_env_var = System.getenv(“REGISTRATION_TOKEN”);
UUID token = null;
if(token_env_var == null && reg_token_env_var == null){
token = UUID.randomUUID();
}else if(token_env_var != null){
token = UUID.fromString(token_env_var);
}else if(reg_token_env_var != null){
token = UUID.fromString(reg_token_env_var);
}
Im not sure if this is a viable solution and if it will work on the submission server but it seems to work for me locally.