Need help with double unassigned local variable

Ignore the horrible coding form…
Here is the full code:

    #region " Referenced assemblies "
    // - UnityEngine v0.0.0.0
    // - mscorlib v2.0.0.0
    // - uLink v0.0.0.0
    // - System.Core v3.5.0.0
    // - System v2.0.0.0
    // - Newtonsoft.Json v4.5.0.0
    // - SteamworksManaged v1.0.0.0
    // - ICSharpCode.SharpZipLib v0.86.0.518
    // - JsonFx.Json v1.4.1003.3008
    // - Ionic.Zip.Reduced v1.9.1.9000
    // - protobuf-net v2.0.0.668
    // - POpusCodec v1.0.0.0
    // - NSpeex v1.1.3.0
    // - KGFUtils.Settings v1.0.4512.18287
    // - SmartAssembly.Attributes v6.0.0.0
    // - Assembly-CSharp v0.0.0.0
    #endregion 
    
    public class ResourceHandler : EntityBehaviour
    {
        private Dictionary<ResourceType, float> _pendingResourceChanges = new Dictionary<ResourceType, float>();
        public Action<ResourceAmount> BeforeResourceAdded;
        public float UpdateRate = 0.25f;
        private float updateTimer;
    
        public void AddPending(ResourceAmount resource)
        {
            if (resource.Amount != 0f)
            {
                if (this.BeforeResourceAdded != null)
                {
                    this.BeforeResourceAdded(resource);
                }
                if (this._pendingResourceChanges.ContainsKey(resource.resourceType))
                {
                    Dictionary<ResourceType, float> dictionary;
                    ResourceType type;
                    float num = dictionary [type];
                    (dictionary = this._pendingResourceChanges)[type = resource.resourceType] = num + resource.Amount;
                }
                else
                {
                    this._pendingResourceChanges.Add(resource.resourceType, resource.Amount*100);
                }
            }
        }
    }

The fault is at this line:

             float num = dictionary [type];

They both say “Use of unassigned local variable” for dictionary and type.
Anybody have any idea what Is wrong/what I can do?

dictionary and type are never assigned a value

to assign a value to a variable you have to use “=”, i.e.

Dictionary<ResourceType, float> dictionary=new Dictionary<ResourceType, float>();