klass = mono_object_class (obj);
if (klass == mono_defaults.string_class) {
char *utf8 = mono_string_to_utf8_checked ((MonoString*)obj, &error);
- mono_error_raise_exception (&error); /* FIXME don't raise here */
- if (strlen (utf8) > 60) {
+ mono_error_cleanup (&error); /* FIXME don't swallow the error */
+ if (utf8 && strlen (utf8) > 60) {
utf8 [57] = '.';
utf8 [58] = '.';
utf8 [59] = '.';
utf8 [60] = 0;
}
- g_print ("String at %p, length: %d, '%s'\n", obj, mono_string_length ((MonoString*) obj), utf8);
+ if (utf8) {
+ g_print ("String at %p, length: %d, '%s'\n", obj, mono_string_length ((MonoString*) obj), utf8);
+ } else {
+ g_print ("String at %p, length: %d, unable to decode UTF16\n", obj, mono_string_length ((MonoString*) obj));
+ }
g_free (utf8);
} else if (klass->rank) {
MonoArray *array = (MonoArray*)obj;
return mcpath;
}
+/* this is an icall */
static MonoString *
get_bundled_app_config (void)
{
// Retrieve config file and remove the extension
config_file_name = mono_string_to_utf8_checked (file, &error);
- mono_error_raise_exception (&error); /* FIXME don't raise here */
+ if (mono_error_set_pending_exception (&error))
+ return NULL;
config_file_path = mono_portability_find_file (config_file_name, TRUE);
if (!config_file_path)
config_file_path = config_file_name;