This is not enough code to reproduce the issue. Why do you believe the SelectedItem is NULL, have you checked it using the debugger or is this just an assumption? It really doesn't make sense based on the few posted code snippets. You should post code that reproduces the problem when asking for a code review. —
BionicCode 33 secs ago