diff --git a/pform.cc b/pform.cc index a09925761..5b163f963 100644 --- a/pform.cc +++ b/pform.cc @@ -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)