AnthonyLins / facebook-actionscript-api

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

JavascriptRequestHelper Null Argument #94

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Pass null as an argument like so: fbConnect.callMethod("someMethod", "", 
[1, 2], null, "five");

What is the expected output? What do you see instead?
One expects to see just plain null as a parameter in the jsbridge method 
rather than null surrounded by quotation marks.

What version of the product are you using? On what operating system?
V. 3.3 on Windows Vista Home Premium 64bit

Please provide any additional information below.

After stepping through this issue in fdb, I added a null value check in 
JavascriptRequestHelper.formatParams.  Here is the new version of the 
function which works for me:

public static function formatParams(params:Array):String {
    var newParams:Array = [];
    var l:uint = params.length;
    for (var i:uint=0;i<l;i++) {
    var value:Object = params[i];
    if (value != null) {
        var qualifiedClassName:String = getQualifiedClassName
(value);
        switch (qualifiedClassName) {
            case 'Array':
            value = '['+value.join(', ')+']'; break;
            case 'Object':
            value = objectToString(value); break;
            case 'String':
            default:
            value = '"'+value+'"'; break;
        }
    }
    else {
        value = "null";
    }
    newParams.push(value);
     }
     return newParams.join(', ');
}

Original issue reported on code.google.com by rwale...@gmail.com on 5 Nov 2009 at 8:50

GoogleCodeExporter commented 9 years ago
New release based of Facebook's Graph API is coming soon.  SDK which this issue 
depends on is no longer supported by Facebook.

Original comment by alan...@gmail.com on 29 Sep 2010 at 7:49