function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Teach_me_howTeach_me_how 

Is this effect of Winter 13?

 

Removing of null to set gives an error "System.NullPointerException:Argument 1 cannot be null"

 

Ex.

 

acctid.remove(null); <------ This will give error in winter 13 but not in summer 12

 

Please help me to understand what is wrong i maybe missing something here. Thanks

Best Answer chosen by Admin (Salesforce Developers) 
Rahul SharmaRahul Sharma

Teach_me_how,

 

Confirmed in my sandbox, Working in summer'12 SB but thowing null pointer exception in Winter'13 SB as you said.

Seems a bug.

Sites in my winter'13 SB is not getting loaded.

All Answers

Jia HuJia Hu
I guess acctid is a Map,...
Yeah, it is different with .remove(null) in Summer'12 and Winter'13 as you said.

But if you test with .remove(null) method with List or Set, they will return a error in Summer'12,
so I guess Salesforce revise it in a right way this time.
Teach_me_howTeach_me_how

myvariable is a SET

 

myset.remove(null);

 

In summer 12 this code does NOT get error

In winter 13 this code get an error

 

Unfortunately i have no summer 12 sandbox left so i can check what i believe that it did not get an error in summer 12

Rahul SharmaRahul Sharma

Teach_me_how,

 

Confirmed in my sandbox, Working in summer'12 SB but thowing null pointer exception in Winter'13 SB as you said.

Seems a bug.

Sites in my winter'13 SB is not getting loaded.

This was selected as the best answer
eugene_bmeugene_bm

yes. wha is happening in SF?? I also encountered the same error. Please have it solve in no time!! :c

cmendlercmendler

ETA on a fix?

cmendlercmendler

This is a known issue, you can help vote for a quick fix here:

 

https://sites.secure.force.com/success/issues_view?id=a1p30000000SThrAAG

 

We need a lot more votes,  Otherwise we may not see this resolved for a few weeks!

sfdcbustedsfdcbusted

UP!

Jia HuJia Hu
Just got the feedback from Salesforce, they said they plan to revise it in this week.
Teach_me_howTeach_me_how

I tried this shortterm fix.. but im not infavor of doing this in all my codes

 

create another set and add null value to it then use the .removeAll method of set:

 

Ex.

set<string> mystr = new set<string>();
mystr.add('a');
mystr.add(null);

 

set<string> mystr2 = new set<string>();
mystr2.add(null);

 

mystr.removeAll(mystr2);
system.debug(mystr);

cmendlercmendler

Fix is scheduled for 9/12 late night.  /safeharborandallofthat

Rahul SharmaRahul Sharma

I would like to know from where you get that info. Did you create that case?

Thanks for the update cmendler,

cmendlercmendler

We had multiple cases submitted and we were told by our Premier Support Rep that tomorrow was the target date