Selaa lähdekoodia

[cpp] Ensure that String is not null before matching a catch statement

Hugh Sanderson 6 vuotta sitten
vanhempi
commit
2c35a5f9a8
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  1. 2 0
      src/generators/gencpp.ml

+ 2 - 0
src/generators/gencpp.ml

@@ -3958,6 +3958,8 @@ let gen_cpp_ast_expression_tree ctx class_name func_name function_args function_
                 | TCppInterface(klass) ->
                    let hash = (cpp_class_hash klass) in
                    output_i (!else_str ^ "if (hx::TIsInterface< (int)" ^ hash  ^ " >(_hx_e.mPtr))")
+                | TCppString ->
+                   output_i (!else_str ^ "if (_hx_e.IsClass< ::String >() && _hx_e->toString()!=null() )");
                 | _ ->
                    if (type_name="Dynamic") then begin
                       seen_dynamic := true;