parnoldx / nasc

Do maths like a normal person

Home Page:http://parnoldx.github.io/nasc/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash on function declaration with number in name without expression

MEXAHOTABOP opened this issue · comments

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:

  1. Open empty sheet in NaSC
  2. Type function f1
  3. 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