+ Start a Discussion
Angela SchloederAngela Schloeder 

Only 1 User receives this error: Attempt to de-reference a null object

I have 1 User that is receiving this error and i do not know why. I have even created a new profile; didn't work. So I created a new user for him; still get same error.
This is a visualforce page of the users tasks that can be modified and saed on the page without having to open the Task.

Attempt to de-reference a null object
Error is in expression '{!saveRecord}' in component <apex:commandButton> in page allopentasks: Class.TaskController.saveRecord: line 145, column 1
John PipkinJohn Pipkin
Angela, null-pointers can be caused by several things. If the user does not have access to the field (field-level security), it would cause this. It could also be a data issue (user not filling out something that the code needs or filling it out incorrectly). Check on line 145 of your code for anything object that is being referenced (with dot notation) and add debug statements in your code to see what is going on. If you still can't figure it out, please reply with the line that is throwing the exception
Arun KumarArun Kumar
Hi Angela,

It's due to the record which this user is trying to save is not having some field accessibility. Kindly check the FLS for that user's profile against this object which you are saving in the code.