@@ -1224,14 +1224,22 @@ arv_device_set_features_from_string (ArvDevice *device, const char *string, GErr
12241224 ARV_DEVICE_ERROR_INVALID_PARAMETER ,
12251225 "Invalid address in %s" , key );
12261226 } else {
1227- int_value = g_ascii_strtoll (value , & end , 0 );
1228- if (end == NULL || end [0 ] != '\0' ) {
1227+ if (value == NULL || strlen (value ) == 0 ) {
12291228 g_set_error (& local_error ,
12301229 ARV_DEVICE_ERROR ,
12311230 ARV_DEVICE_ERROR_INVALID_PARAMETER ,
1232- "Invalid %s value for %s" , value , key );
1231+ "Value not found for %s" , key );
12331232 } else {
1234- arv_device_write_register (device , address , int_value , & local_error );
1233+ int_value = g_ascii_strtoll (value , & end , 0 );
1234+ if (end == NULL || end [0 ] != '\0' ) {
1235+ g_set_error (& local_error ,
1236+ ARV_DEVICE_ERROR ,
1237+ ARV_DEVICE_ERROR_INVALID_PARAMETER ,
1238+ "Invalid %s value for %s" , value , key );
1239+ } else {
1240+ arv_device_write_register (device , address , int_value ,
1241+ & local_error );
1242+ }
12351243 }
12361244 }
12371245 } else {
0 commit comments