openvv icon indicating copy to clipboard operation
openvv copied to clipboard

Uncaught TypeError: Cannot read property 'left' of undefined

Open AgileMantis opened this issue 9 years ago • 8 comments

I noticed that in positionBeacons(), line 1092, its checking for truthy on lastPlayerLocation, but not for playerLocation, which could throw undefined errors looking at playerLocation.left, etc.

    // when we don't have an initial position, or the position hasn't changed 
    if (lastPlayerLocation && (lastPlayerLocation.left === playerLocation.left && lastPlayerLocation.right === playerLocation.right && lastPlayerLocation.top === playerLocation.top && lastPlayerLocation.bottom === playerLocation.bottom)) {
        // no need to update positions
        return;
    }

AgileMantis avatar Jun 05 '15 21:06 AgileMantis

Issue a pull reqeust

AgileMantis avatar Jun 05 '15 22:06 AgileMantis

I didn't run any unit tests, not quite sure how and ran out of time! (It's Friday at 5pm)

I also noticed this appears to be fixed in RC 1.2, so reject Pull if you want.

AgileMantis avatar Jun 05 '15 22:06 AgileMantis

I am also seeing Uncaught TypeError: Cannot read property 'left' of undefined if the element is no longer on the page. You can see an example of this here. When the preroll is complete the SWFObject is removed from the page and positionBeacons() continues to check for it's location and cannot retrieve the client recs.

trainwreck_s_amy_schumer_and_judd_apatow_on_standup_routines___vanity_fair

louisjimenez avatar Jun 08 '15 19:06 louisjimenez

I am also seeing this on my site. I also don't understand why you use setInterval instead of setTimeout (as I understand this, this function should be executed once).

BranoMatan avatar Dec 15 '15 16:12 BranoMatan

any update on this? is there a workaround?

The video ends up being choppy because of the amount of exceptions thrown

eridal avatar Jan 22 '16 18:01 eridal

Seems like this was fixed by https://github.com/InteractiveAdvertisingBureau/openvv/commit/48308046413ccbd1ddb99bf8427a4d41f26f3f4b

..but somehow this is out of our dependency chain

eridal avatar Jan 22 '16 18:01 eridal

It was fixed as part of the latest release v2.5.

alonashkenazi avatar Jan 22 '16 18:01 alonashkenazi

Thanks!

OP may close this issue

eridal avatar Jan 22 '16 19:01 eridal