From 587ef0ed61ce8bde86eec69c1727c302d0b94845 Mon Sep 17 00:00:00 2001 From: Yuxiao Mao Date: Wed, 15 Jan 2025 10:03:10 +0100 Subject: [PATCH] [hlmem] prevent unexpected null from TType.toString --- other/haxelib/hlmem/Memory.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/other/haxelib/hlmem/Memory.hx b/other/haxelib/hlmem/Memory.hx index 729977962..555e7f91b 100644 --- a/other/haxelib/hlmem/Memory.hx +++ b/other/haxelib/hlmem/Memory.hx @@ -100,7 +100,7 @@ class Memory { public function getTypeString( id : Int, withTstr : Bool, withId : Bool, withField : Bool ) : String { var tid = id & 0xFFFFFF; var t = types[tid]; - var tstr = withTstr ? t.toString() : ""; + var tstr = withTstr ? "" + t.toString() : ""; if( withId ) tstr += Analyzer.withColor("#" + tid, Magenta); var fid = id >>> 24; @@ -603,7 +603,7 @@ class Memory { public function getFalsePositives( ?typeStr : String ) : FalsePositiveStats { var ctx = new FalsePositiveStats(); for( t in types ) - if( t.falsePositive > 0 && (typeStr == null || t.toString().indexOf(typeStr) >= 0) ) { + if( t.falsePositive > 0 && (typeStr == null || ("" + t.toString()).indexOf(typeStr) >= 0) ) { ctx.add(t); } ctx.sort();