1
0
Fork 0

Don't return invalid JSON if node not found

This commit is contained in:
Torsten Dreyer 2014-03-25 21:43:08 +01:00
parent e7dec994b8
commit f68ae55068

View file

@ -58,8 +58,8 @@ bool JsonUriHandler::handleGetRequest( const HTTPRequest & request, HTTPResponse
SGPropertyNode_ptr node = fgGetNode( string("/") + propertyPath );
if( false == node.valid() ) {
response.StatusCode = 400;
response.Content = "Node not found: " + propertyPath;
SG_LOG(SG_NETWORK,SG_WARN, "Node not found: '" << response.Content << "'");
response.Content = "{}";
SG_LOG(SG_NETWORK,SG_WARN, "Node not found: '" << propertyPath << "'");
return true;
}