Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admin.hx:221 #5

Open
delahee opened this issue Feb 18, 2014 · 2 comments
Open

admin.hx:221 #5

delahee opened this issue Feb 18, 2014 · 2 comments

Comments

@delahee
Copy link

delahee commented Feb 18, 2014

Sometime toString() call fails, I use something alike :

var str = null;
                try{ str = defval.toString();} catch(d:Dynamic){};
                if( str==null){
                    try { str = Std.string( defval ); }  catch (d:Dynamic) { };
                }
                if( str!=null)
                    defval = new Serialized(str).escape();
                else {
                    defval="#unknown";
                }

But I don't really get the whole picture so it might induce problems... so maybe you can do an improvement here :)

thx

@ncannasse
Copy link
Owner

defval.toString() and Std.string(defval) should do exactly the same thing. Why is toString failing in the first place?

@delahee
Copy link
Author

delahee commented Feb 18, 2014

try{
defval = new Serialized(defval.toString()).escape();
}catch(d:Dynamic){ throw d+" "+defval;};

Invalid call defaval = {}
Called from sys.db.Admin::inputField line 235
Called from a C function
Called from sys.db.Admin::edit line 519
Called from sys.db.Admin::process line 1052
Called from sys.db.Admin::handler line 1079

:)

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

No branches or pull requests

2 participants