When creating a port on FreeBSD, I noticed a port using tzlocal would not run because the timezone reported was ' '. Apparently on some FreeBSD systems /etc/timezone exists but is empty, so tzlocal would open the file but return an invalid time zone, causing the program to crash. I added a clause in the if statement that checked if the file is empty in addition to existing, which fixed the crash.
When creating a port on FreeBSD, I noticed a port using tzlocal would not run because the timezone reported was ' '. Apparently on some FreeBSD systems /etc/timezone exists but is empty, so tzlocal would open the file but return an invalid time zone, causing the program to crash. I added a clause in the if statement that checked if the file is empty in addition to existing, which fixed the crash.