File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -765,6 +765,8 @@ def prepare_str(str_in: str) -> dict[str, str]:
765765 key_val_list : list [str ] = str_in .split ("=" )
766766 if len (key_val_list ) != 2 :
767767 raise ModelicaSystemError (f"Invalid 'key=value' pair: { str_in } " )
768+ if len (key_val_list [0 ]) == 0 :
769+ raise ModelicaSystemError (f"Empty key: { str_in } " )
768770
769771 input_data_from_str : dict [str , str ] = {str (key_val_list [0 ]): str (key_val_list [1 ])}
770772
@@ -792,7 +794,12 @@ def prepare_str(str_in: str) -> dict[str, str]:
792794 raise ModelicaSystemError (f"Invalid input data type for set*() function: { type (item )} !" )
793795 input_data = input_data | prepare_str (item )
794796 elif isinstance (input_arg , dict ):
795- input_data = input_data | input_arg
797+ input_arg_str : dict [str , str ] = {}
798+ for key , val in input_arg :
799+ if not isinstance (key , str ) or len (key ) == 0 :
800+ raise ModelicaSystemError (f"Invalid key for set*() functions: { repr (key )} " )
801+ input_arg_str [key ] = str (val )
802+ input_data = input_data | input_arg_str
796803 else :
797804 raise ModelicaSystemError (f"Invalid input data type for set*() function: { type (input_arg )} !" )
798805
You can’t perform that action at this time.
0 commit comments