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

Unable to message: createForward Returning Null Pointer Exception #2179

Open
raghucha opened this issue Oct 1, 2024 · 1 comment
Open

Unable to message: createForward Returning Null Pointer Exception #2179

raghucha opened this issue Oct 1, 2024 · 1 comment
Labels
area:documentation Focused on documentation of the product type:bug A broken experience

Comments

@raghucha
Copy link

raghucha commented Oct 1, 2024

Describe the bug

As described in documentation createForward. The code functionality is broken

It throws a Null Pointer exception

Expected behavior

the below code is expected to create a Draft message
var result = graphClient.me().messages().byMessageId("{message-id}").createForward().post(null);

How to reproduce

graphServiceClient
        .users()
        .byUserId("[email protected]")
        .messages()
        .byMessageId("{replace-message-id}")
        .createForward().post(null);

SDK Version

6.16.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log

Exception in thread "main" java.lang.NullPointerException at java.util.Objects.requireNonNull(Objects.java:203) at com.microsoft.graph.users.item.messages.item.createforward.CreateForwardRequestBuilder.post(CreateForwardRequestBuilder.java:59) at com.microsoft.graph.users.item.messages.item.createforward.CreateForwardRequestBuilder.post(CreateForwardRequestBuilder.java:47) at org.example.Main.main(Main.java:97)

Configuration

No response

Other information

No response

@raghucha raghucha added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Oct 1, 2024
@Ndiritu
Copy link
Contributor

Ndiritu commented Oct 3, 2024

@raghucha thank you for creating this issue.

This is an issue with the code snippet. Passing a new "empty" body object should work:

var result = graphClient.me().messages().byMessageId("{message-id}").createForward().post(new CreateForwardPostRequestBody()); 

Lmk if this helps.

@Ndiritu Ndiritu added area:documentation Focused on documentation of the product and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:documentation Focused on documentation of the product type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

2 participants