CONN-1437

Fixed possible null dereferences