Bugfix: If null or whitespace then set empty string (nullptr exception).

This commit is contained in:
Peter Rekdal Sunde
2015-07-10 13:29:45 +02:00
parent 32f7c400d6
commit 5d9e1220bc

View File

@@ -121,6 +121,11 @@ namespace openalprnet
} }
void set(String^ value) void set(String^ value)
{ {
if(String::IsNullOrWhiteSpace(value))
{
this->m_config->prewarp = "";
return;
}
this->m_config->prewarp = marshal_as<std::string>(value); this->m_config->prewarp = marshal_as<std::string>(value);
} }
} }
@@ -407,6 +412,11 @@ namespace openalprnet
} }
void set(String^ value) void set(String^ value)
{ {
if (String::IsNullOrWhiteSpace(value))
{
this->m_config->prewarp = "";
return;
}
this->m_config->ocrLanguage = marshal_as<std::string>(value); this->m_config->ocrLanguage = marshal_as<std::string>(value);
} }
} }