X-Git-Url: http://pilppa.org/gitweb/?p=libplp.git;a=blobdiff_plain;f=src%2FDataReader.cc;fp=src%2FDataReader.cc;h=9731bce6170c6e007e2d4bda7042f6507ce1b5d9;hp=0e6ebf380fb2e335fb028956607abd8f430891d7;hb=1f4c845decad23299609aa00ee97ba1c61a1f027;hpb=6114bb5f252afb1e86682836b82db3e4c48213fe diff --git a/src/DataReader.cc b/src/DataReader.cc index 0e6ebf3..9731bce 100644 --- a/src/DataReader.cc +++ b/src/DataReader.cc @@ -441,14 +441,19 @@ string DataReader::get_device_id() { } /** - * Read device type from the device specific config file + * Read device type from the device specific config file. + * + * @rerurn string representing device type. + * In the case of error, an empty string is returned. */ string DataReader::get_device_type() { string ret_val; if (device_config == NULL) { device_config = DeviceConfig::get_device_config(device_id); - ret_val = device_config->get_config_value(DEVICE_CONFIG_VALUE_KEY__TYPE); + } + if (device_config != NULL) { + ret_val = device_config->get_config_value(DEVICE_CONFIG_VALUE_KEY__TYPE); } return ret_val; }