Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Unable to message: createForward Returning Null Pointer Exception

Open
#2,179 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
api

Research direction

Start with CreateForwardRequestBuilder.java at the stack-trace location and compare it with the createForward reproduction in the issue. Run the users/messages/byMessageId/createForward call from Main.java line 97 using SDK version 6.16.0. Done means the call creates a draft message without throwing a NullPointerException.

Written by the indexing model from the issue text.

Description

area:documentation type:bug
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("replace@userid.com")
        .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

Dominant language
Java
Stars
444
Forks
154
Avg merge
18h 28m
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoftgraph/msgraph-sdk-java

All issues in microsoftgraph/msgraph-sdk-java

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.