diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationRegistry.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationRegistry.cxx index ffc0f5c5b49a3341a34ddae54331299dc97e7f64..f98f9a3cbc23f49c12fdf576765c52a9a93cbc11 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationRegistry.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplicationRegistry.cxx @@ -159,8 +159,11 @@ ApplicationRegistry::CreateApplicationFaster(const std::string& name) #endif const char* otbAppPath = itksys::SystemTools::GetEnv("OTB_APPLICATION_PATH"); - - std::vector<itksys::String> pathList = itksys::SystemTools::SplitString(otbAppPath,pathSeparator,false); + std::vector<itksys::String> pathList; + if (otbAppPath) + { + pathList = itksys::SystemTools::SplitString(otbAppPath,pathSeparator,false); + } for (unsigned int i=0 ; i<pathList.size() ; ++i) { std::string possiblePath = pathList[i]; @@ -205,7 +208,11 @@ ApplicationRegistry::GetAvailableApplications(bool useFactory) #endif const char* otbAppPath = itksys::SystemTools::GetEnv("OTB_APPLICATION_PATH"); - std::vector<itksys::String> pathList = itksys::SystemTools::SplitString(otbAppPath,pathSeparator,false); + std::vector<itksys::String> pathList; + if (otbAppPath) + { + pathList = itksys::SystemTools::SplitString(otbAppPath,pathSeparator,false); + } for (unsigned int k=0 ; k<pathList.size() ; ++k) { itk::Directory::Pointer dir = itk::Directory::New();