# My bug or Flash bug?

**URL:** <https://forum.kirupa.com/t/my-bug-or-flash-bug/236178>\
**Category:** flash\
**Created:** [August 17, 2007, 10:46pm UTC](https://forum.kirupa.com/t/my-bug-or-flash-bug/236178 "2007-08-17T22:46:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oybrator](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/oybrator/32/1384_2.png) [@oybrator](https://forum.kirupa.com/u/oybrator)\
**Post date:** [August 17, 2007, 10:46pm UTC](https://forum.kirupa.com/t/my-bug-or-flash-bug/236178/1 "2007-08-17T22:46:31Z")

</div>

Here’s a peice of code extracted from a shopping cart class i am working on:

```auto
	private function getMissingProperties(obj:Object):String
	{
		var errorString:String = "";
		var nProps:Number = this.cartItemPropertyNames.length;

		for (var i:Number = 0; i < nProps; i++)
		{
			var propName:String = this.cartItemPropertyNames*;
			var prop:String = obj[propName];
			if (prop != "amount" && prop == undefined);
			{
				errorString += propName + "(" + i + ") = " + prop + "
";
			}
		}
		
		return errorString;
	}

```

Now the question: Why does this function keep returning this:

id(0) = testIdForSmurfer  
name(1) = Smurfer  
amount(2) = undefined

It certainly looks like the line if (prop != “amount” && prop == undefined) shouldn’t kick in as the values in the return string definately indicate that the properties to be checked for existence are indeed existing and that the “amount” property is beeing counted in even though it should not.

Any ideas?
