dbadmin icon indicating copy to clipboard operation
dbadmin copied to clipboard

admin.hx:221

Open delahee opened this issue 11 years ago • 2 comments

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

delahee avatar Feb 18 '14 08:02 delahee

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

ncannasse avatar Feb 18 '14 08:02 ncannasse

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

:)

delahee avatar Feb 18 '14 09:02 delahee