Fix for br1003 - prevent segfault when delays are used outside a module.

This commit is contained in:
Martin Whitaker 2016-07-12 20:59:50 +01:00
parent 43cd693fe0
commit b8f9ed27c5
1 changed files with 4 additions and 1 deletions

View File

@ -1066,7 +1066,10 @@ void pform_set_timeunit(const char*txt, bool in_module, bool only_check)
int pform_get_timeunit()
{
return pform_cur_module.front()->time_unit;
if (pform_cur_module.front())
return pform_cur_module.front()->time_unit;
else
return pform_time_unit;
}
void pform_set_timeprecision(const char*txt, bool in_module, bool only_check)