Crash on function declaration with number in name without expression
MEXAHOTABOP opened this issue · comments
MEXAHOTABOP commented
Describe the bug
NaSC crashes when you try decelerate function with number in name without expression
[FATAL 15:51:43.595707] string_chug: assertion 'self != NULL' failed
[FATAL 15:51:43.595723] string_chomp: assertion 'self != NULL' failed
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_M_construct null not valid
To Reproduce
Steps to reproduce the behavior:
- Open empty sheet in NaSC
- Type
function f1
- Program crashed
Expected behavior
https://github.com/parnold-x/nasc/blob/master/src/Calculator.vala#L234 must have a check that expression part is not null before using it
Desktop (please complete the following information):
- OS: Arch linux current
- Version 0.8.0