But that part of the code has nothing to do with the removing part of the method? I thought I would get an error or warning or something if I just used:
fremst = fremst.neste; denne = fremst;
since the first line then would try to set the next first in line to a customer who doesn't exist...?
Yes it does. Since, according to the code you posted, those "copy lines" take place in an "else block". So, if fremst is null it will never make it to those "copy lines", so it can never throw an NPE. Which is why I say that either the code is not the right code or the NPE is coming from somewhere else.
Also, there is no problem, whatsoever, in setting a reference null. You get an NPE when you then attempt to use that null reference (i.e. fremst.neste throws the NPE when fremst is null, but fremst = fremst.neste works just fun when fremst is not null, but fremst.neste is null).