Hi Alex, the problem is that msg is an Object and headers is not coming so is undefined, not null, and the property doesn't exits. So if I understand right the right way would be to check != undefined. If in this scenario I could change for != null I can do it, but I tough is not valid
El mié., 20 mar. 2019 a las 16:37, Alex Harui (<[email protected]>) escribió: > Hi Carlos, > > I guess that’s ok, but I expected you would just test for “!= null”. Is > null an allowed value with a different meaning than undefined? > > -Alex > > From: Carlos Rovira <[email protected]> > Date: Wednesday, March 20, 2019 at 2:44 AM > To: "[email protected]" <[email protected]>, Alex Harui < > [email protected]> > Subject: Re: [royale-asjs] branch develop updated: amfchannel: ensure > headers are not undefined, this is needed in shared enviroments when the > application can be hosted in a domain but served through other domain. In > this cases interacting with AMF can produce ... > > Hi Alex, you're right. I committed a different notation that removes > warnings. Let me know if is ok for you. > thanks > > El mié., 20 mar. 2019 a las 1:49, Alex Harui (<[email protected]>) > escribió: > Carlos, > > This change is causing warnings. Are you not getting the same warnings? > > -Alex > > frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as(549): > col: 21 Illogical comparison with undefined. Only untyped variables (or > variables of type *) can be undefined. > > frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as(545): > col: 62 Illogical comparison with undefined. Only untyped variables (or > variables of type *) can be undefined. > > On 3/19/19, 10:37 AM, "[email protected]<mailto: > [email protected]>" <[email protected]<mailto: > [email protected]>> wrote: > > This is an automated email from the ASF dual-hosted git repository. > > carlosrovira pushed a commit to branch develop > in repository > https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&data=02%7C01%7Caharui%40adobe.com%7C35235ceb47444d6a133008d6ac918194%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636886138274728662&sdata=vGYTijIVYA28CqdBGvQ4cOMUn2TKbfbQi%2BkIqvtchkY%3D&reserved=0 > < > https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&data=02%7C01%7Caharui%40adobe.com%7Cadd106c33ad74affbc2308d6ad18a0de%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636886718648991008&sdata=cXaRL%2BL8ZAZZ2P1D7%2FOoND7qKBmZifZEoSqfkTnbCk8%3D&reserved=0 > > > > > The following commit(s) were added to refs/heads/develop by this push: > new 9efd0d4 amfchannel: ensure headers are not undefined, this > is needed in shared enviroments when the application can be hosted in a > domain but served through other domain. In this cases interacting with AMF > can produce access denied (401) errors that can generate messages without > headers, but we still want Royale executes its faulhandler > 9efd0d4 is described below > > commit 9efd0d41ef153025d20447362ec1b66c1889303c > Author: Carlos Rovira <[email protected]<mailto: > [email protected]>> > AuthorDate: Tue Mar 19 18:36:56 2019 +0100 > > amfchannel: ensure headers are not undefined, this is needed in > shared enviroments when the application can be hosted in a domain but > served through other domain. In this cases interacting with AMF can produce > access denied (401) errors that can generate messages without headers, but > we still want Royale executes its faulhandler > --- > .../MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as > | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git > a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as > b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as > index 8803f6b..3938a04 100644 > --- > a/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as > +++ > b/frameworks/projects/MXRoyale/src/main/royale/mx/messaging/channels/AMFChannel.as > @@ -542,11 +542,11 @@ public class AMFChannel extends > NetConnectionChannel > _log.debug("'{0}' fault handler called. {1}", id, > msg.toString()); > > // Set the server assigned RoyaleClient Id. > - if (RoyaleClient.getInstance().id == null && > msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER] != null) > + if (RoyaleClient.getInstance().id == null && > msg.headers != undefined && > msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER] != null) > RoyaleClient.getInstance().id = > msg.headers[AbstractMessage.FLEX_CLIENT_ID_HEADER]; > > // Process the features advertised by the server > endpoint. > - if (msg.headers[CommandMessage.MESSAGING_VERSION] != > null) > + if (msg.headers != undefined && > msg.headers[CommandMessage.MESSAGING_VERSION] != null) > { > var serverVersion:Number = > msg.headers[CommandMessage.MESSAGING_VERSION] as Number; > handleServerMessagingVersion(serverVersion); > > > > > -- > Carlos Rovira > http://about.me/carlosrovira< > https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&data=02%7C01%7Caharui%40adobe.com%7Cadd106c33ad74affbc2308d6ad18a0de%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636886718649001017&sdata=WAL6rkfjyGpUf4czpq56vccaP%2FRXPDy0ewMJALYCuRg%3D&reserved=0 > > > > -- Carlos Rovira http://about.me/carlosrovira
