mirror of
https://github.com/nasa/trick.git
synced 2024-12-30 01:48:52 +00:00
Trick View: Can't set variables with -- units #301
Test before trying to convert NULL char * to string.
This commit is contained in:
parent
b32015a1ad
commit
c4a32600cc
@ -525,8 +525,11 @@ int var_set_base( const char * var , T value , const char * units ) {
|
||||
V_DATA v_data ;
|
||||
v_tree.v_data = &v_data ;
|
||||
var_set_value( v_data , value) ;
|
||||
//ref->units = (char *)units ;
|
||||
ref->units = (char *)(map_trick_units_to_udunits(units).c_str()) ;
|
||||
if ( units != NULL ) {
|
||||
ref->units = (char *)(map_trick_units_to_udunits(units).c_str()) ;
|
||||
} else {
|
||||
ref->units = (char *)units ;
|
||||
}
|
||||
ref_assignment(ref , &v_tree) ;
|
||||
free(ref) ;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user