From 1849c9cc76a246a58811d50ef54b35bc8b2d81d6 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Tue, 7 Apr 2020 10:16:04 +0200 Subject: [PATCH] #5757 Python : Report error message if no result is created --- .../GrpcInterface/RiaGrpcPdmObjectService.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/ApplicationCode/GrpcInterface/RiaGrpcPdmObjectService.cpp b/ApplicationCode/GrpcInterface/RiaGrpcPdmObjectService.cpp index 535fe948c8..e07eeabc5e 100644 --- a/ApplicationCode/GrpcInterface/RiaGrpcPdmObjectService.cpp +++ b/ApplicationCode/GrpcInterface/RiaGrpcPdmObjectService.cpp @@ -527,12 +527,19 @@ grpc::Status RiaGrpcPdmObjectService::CallPdmObjectMethod( grpc::ServerContext* copyPdmObjectFromRipsToCaf( &( request->params() ), method.get() ); caf::PdmObjectHandle* result = method->execute(); - copyPdmObjectFromCafToRips( result, reply ); - if ( !method->resultIsPersistent() ) + if ( result ) { - delete result; + copyPdmObjectFromCafToRips( result, reply ); + if ( !method->resultIsPersistent() ) + { + delete result; + } + return grpc::Status::OK; + } + else + { + return grpc::Status( grpc::NOT_FOUND, "No result returned from Method" ); } - return grpc::Status::OK; } return grpc::Status( grpc::NOT_FOUND, "Could not find Method" ); }