Closed floyd-fuh closed 1 year ago
Hi Floyd
Thank you for raising this. We're looking into this and will be considering some solutions to handle this in a better way.
If there's anything else we can help with, then please let us know.
Please also fix the same issue with the PersistedObject
functions, it says in the Javadoc that it might return null, but doesn't declare it as Optional
, why? For example:
Not knowing when things could be null makes developing a trial and error process. I much rather have the IDE remind me that things could be null and I factor that in from the beginning.
Hi Floyd
We'll be reviewing this behavior for all Pro-only functionality (Scanner, Collaborator, Persistable objects), and looking into if there's anything we can do to make this easier for you (as suggested on the other raised issue, possibly adding additional annotations).
When I use the following code:
on community edition I get:
java.lang.NullPointerException: Cannot invoke "burp.api.montoya.collaborator.CollaboratorClient.getSecretKey()" because "client" is null
I guess the best would be if
api.collaborator()
would declare to returnOptional<Collaborator>
rather thanCollaborator
:https://github.com/PortSwigger/burp-extensions-montoya-api/blob/8b6d0c237c29e4821fd7e6595719e1761a75e272/src/main/java/burp/api/montoya/MontoyaApi.java#L51
And obviously for all other Pro-Only functions it should return an
Optional<>
, right?