summaryrefslogtreecommitdiff
path: root/cpp/demo/Ice/value/Client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/demo/Ice/value/Client.cpp')
-rw-r--r--cpp/demo/Ice/value/Client.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/cpp/demo/Ice/value/Client.cpp b/cpp/demo/Ice/value/Client.cpp
index 8636b07b94f..246fcceb8bf 100644
--- a/cpp/demo/Ice/value/Client.cpp
+++ b/cpp/demo/Ice/value/Client.cpp
@@ -18,9 +18,15 @@ int
run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
{
Ice::PropertiesPtr properties = communicator->getProperties();
- string ref = properties->getProperty("Value.Initial");
- Ice::ObjectPrx base = communicator->stringToProxy(ref);
+ const char* refProperty = "Value.Initial";
+ std::string ref = properties->getProperty(refProperty);
+ if (ref.empty())
+ {
+ cerr << argv[0] << ": property `" << refProperty << "' not set" << endl;
+ return EXIT_FAILURE;
+ }
+ Ice::ObjectPrx base = communicator->stringToProxy(ref);
InitialPrx initial = InitialPrx::checkedCast(base);
if (!initial)
{