From 5d9e1220bc2c63f36ed22c2e541cae76cd627ebe Mon Sep 17 00:00:00 2001 From: Peter Rekdal Sunde Date: Fri, 10 Jul 2015 13:29:45 +0200 Subject: [PATCH] Bugfix: If null or whitespace then set empty string (nullptr exception). --- src/bindings/csharp/openalpr-net/config-net.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/bindings/csharp/openalpr-net/config-net.h b/src/bindings/csharp/openalpr-net/config-net.h index e591b1a..b1c7331 100644 --- a/src/bindings/csharp/openalpr-net/config-net.h +++ b/src/bindings/csharp/openalpr-net/config-net.h @@ -121,6 +121,11 @@ namespace openalprnet } void set(String^ value) { + if(String::IsNullOrWhiteSpace(value)) + { + this->m_config->prewarp = ""; + return; + } this->m_config->prewarp = marshal_as(value); } } @@ -407,6 +412,11 @@ namespace openalprnet } void set(String^ value) { + if (String::IsNullOrWhiteSpace(value)) + { + this->m_config->prewarp = ""; + return; + } this->m_config->ocrLanguage = marshal_as(value); } }