Skip to content
This repository has been archived by the owner on Feb 6, 2020. It is now read-only.

forQName in TypeQuery can crash #5

Open
jeromedecoster opened this issue May 30, 2010 · 1 comment
Open

forQName in TypeQuery can crash #5

jeromedecoster opened this issue May 30, 2010 · 1 comment

Comments

@jeromedecoster
Copy link

Hello,

The forQName method can throw an Error if there is no qName class registered.

http://github.com/sammyt/fussy/blob/master/src/uk/co/ziazoo/fussy/query/TypeQuery.as#L50

I think it's better to return null instead throw an Error that crash the Player :

public function forQName(qName:String):TypeDescription
{
    var c:Class;
    try { c = getDefinitionByName(qName) as Class; }
    catch(err:Error) {};
    return c != null ? forType(c) : null;
}

Thanks.
J.

@sammyt
Copy link
Owner

sammyt commented Jun 1, 2010

Hello there

Good spot, it raises the question of whether fussy queries should have the application domain they should search within injected.

Until I have done some more thinking about how to deal will multiple app domains I think your suggestion is a good one!

I'll add that with my next push unless you want to fork and correct it yourself?

My best
Sam

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants