do instead:
//get the url for the file name
string fileName = properties.AfterUrl;
//split it when it gets to /
string[] nFileName = url.Split('/')
//return only the file name
fileName = nFileName[1];
as for whay its returning an error its stated in msdn! The file your trying to get is not in the DB on item adding and so will return a null reference object ;), if you need to use SPFile document = properties.ListItem.File; than that needs to be done within the item added not adding!
A File object that represents the file. If the item does not exist, if
the item is a folder, or if the item is not located in a document
library, the File property returns an Object whose ServerObjectIsNull
property is true.
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.listitem.file.aspx
SPItemEventProperties
) is used across all event receivers.