dubhaskar / facebook-actionscript-api

Automatically exported from code.google.com/p/facebook-actionscript-api
0 stars 0 forks source link

Cancelling the login proceedure Error #442

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use FacebookMobile to request application authorization
2. Cancel the authorization process
3. Get a null object reference error

What is the expected output?
============================
That a login failure might occur and pass a 'user canacelled' error string or 
such?

What do you see instead?
========================
[Fault] exception, information=TypeError: Error #1009: Cannot access a property 
or method of a null object reference.

What version of the product are you using?
==========================================
1.8.1

On what operating system?
=========================
Windows 7, Air 3.2

Original issue reported on code.google.com by garypa...@gmail.com on 14 Nov 2012 at 6:00

GoogleCodeExporter commented 8 years ago
OK, I grabbed the source and debugged this myself, 

Line 560 of MobileFacebook -

560: protected function handleLogin(result:Object, fail:Object):void {

I'm noting that both objects are null meaning that the following code then 
references result without checking if it is available

session = new FacebookSession();
session.accessToken = result.access_token;
session.expireDate = (result.expires_in == 0) ? null : 
FacebookDataUtils.stringToDate(result.expires_in);
if (_manageSession) {
    var so:SharedObject = SharedObject.getLocal(SO_NAME);
    so.data.accessToken = session.accessToken;
    so.data.expireDate = session.expireDate;

    so.flush();
}
verifyAccessToken();

A hack if to wrap this with:
if( session ){ ... }

Although, handling this case might be advantageous to alerting the developer 
that the user cancelled this login action.

Gary Paluk
http://www.plugin.io

Original comment by garypa...@gmail.com on 14 Nov 2012 at 6:43

GoogleCodeExporter commented 8 years ago
Yet another issue here seems to be a possible race condition based on cookie 
data perhaps?

Sometimes (It's sporadic upon recompiling my app), after cancelling, when you 
re-enter the login screen, the top left button says 'Leave App' and other times 
it says 'Cancel'. If you click the button when it says 'Leave App', it loads 
facebook into the StageWebView, and warns about couple of JS security Errors.

Error: SECURITY_ERR: DOM Exception 18
 at https://s-static.ak.fbcdn.net/rsrc.php/v2/ym/r/3_F1cB_6Sll.js : 22
fa at https://s-static.ak.fbcdn.net/rsrc.php/v2/yJ/r/wgdIw0LfNtU.js : 6

Gary Paluk
http://www.plugin.io

Original comment by garypa...@gmail.com on 14 Nov 2012 at 8:34

Attachments: