 		
 		public function computeDiff(oldState:Object, newState:Object):*
 		{
+			// convert undefined params to null params
+			if (oldState == null)
+				oldState = null;
+			if (newState == null)
+				newState = null;
+			
 			var type:String = typeof(oldState); // the type of null is 'object'
 			var diffValue:*;
 

					while (i--)
					{
						var value:Object = diffToAdd[i];
						if (value === null || typeof value != 'object')
							baseDiff[i] = value; // avoid function call overhead
						else
							baseDiff[i] = combineDiff(baseDiff[i], value);

				// find new properties
				for (var newName:String in newState)
				{
					if (oldState[newName] === undefined && newState[newName] !== undefined)
					{
						if (!diff)
							diff = {};
