IsRegistered method throw the error

Sep 20 at 5:55 PM
I have faced the following error while checking the particular type/name pair has been registered with the unity container. Any help on this is greatly appreciated.

Value cannot be null.Parameter name: key

Unity version:4.0.1

Stack trace:

System.ArgumentNullException: Value cannot be null.
Parameter: key

at System.Collections.Generic.Dictionary2.FindEntry(TKey key)
at System.Collections.Generic.Dictionary2.ContainsKey(TKey key)
at Microsoft.Practices.Unity.UnityContainer.FillTypeRegistrationDictionary(IDictionary
2 typeRegistrations)
at Microsoft.Practices.Unity.UnityContainer.get_Registrations()
at Microsoft.Practices.Unity.UnityContainerExtensions.IsRegistered(IUnityContainer container, Type typeToCheck, String nameToCheck)

Code:
public static object GetGenericServiceImplementation<T>(Type interfaceType, string registrationName = null)
        {
            Guard.Null("interfaceType", interfaceType);

            object instance = null;

            IUnityContainer container = GetContainer();

            if (container.IsRegistered(interfaceType, interfaceType.Name))
            {
                if (string.IsNullOrEmpty(registrationName))
                    registrationName = interfaceType.Name;

                instance = !string.IsNullOrEmpty(registrationName)
                               ? container.Resolve(interfaceType, registrationName)
                               : container.Resolve(interfaceType);
                return instance;
            }
            else
            {
        // registering the un-register type.
                string serviceInterfaceAssemblyName = interfaceType.Assembly.FullName;
                string serviceInterfaceNameSpace = interfaceType.Namespace;

                string serviceAssemblyName = serviceInterfaceAssemblyName.Replace(ServiceInterfaceName, ServiceName);
                string serviceNameSpaceName = serviceInterfaceNameSpace.Replace(ServiceInterfaceName, ServiceName);
                string typeName = interfaceType.FullName.Replace(serviceInterfaceNameSpace + ".", string.Empty).Remove(0, 1);
                instance = Activator.CreateInstance(serviceAssemblyName, serviceNameSpaceName + "." + typeName).Unwrap();

                container.RegisterType(interfaceType, instance.GetType(), interfaceType.Name, new InterceptionBehavior<PolicyInjectionBehavior>(),
                                           new Interceptor<InterfaceInterceptor>());
            }

        }