Skip to content
Snippets Groups Projects
Commit 87f0d169 authored by Sebastian Hahta's avatar Sebastian Hahta
Browse files

nullptr bugs

parent c311ff39
No related branches found
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
...@@ -172,11 +172,12 @@ T *ftl::config::create(json_t &link, ARGS ...args) { ...@@ -172,11 +172,12 @@ T *ftl::config::create(json_t &link, ARGS ...args) {
cfg->patchPtr(link); cfg->patchPtr(link);
} }
try { T* ptr = dynamic_cast<T*>(cfg);
return dynamic_cast<T*>(cfg); if (ptr) {
} catch(...) { return ptr
}
else {
throw FTL_Error("Configuration URI object is of wrong type: " << id); throw FTL_Error("Configuration URI object is of wrong type: " << id);
//return nullptr;
} }
} }
......
...@@ -140,9 +140,12 @@ void URI::_parse(uri_t puri) { ...@@ -140,9 +140,12 @@ void URI::_parse(uri_t puri) {
else if (uri.fragment.first != NULL) { else if (uri.fragment.first != NULL) {
m_base += std::string(start, uri.fragment.first - start - 1); m_base += std::string(start, uri.fragment.first - start - 1);
} }
else { else if (start) {
m_base += std::string(start); m_base += std::string(start);
} }
else {
m_base += std::string("");
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment