Matt Brooks 08ae19e50d Prevent reloadLogs command from hanging
Previously, when the pm2 reloadLogs command was running as a non-root
user, the process will not release and hangs. The reason for the hang
is that the forked process never closes because the object is empty
and doesn't contain the expected object. This commit checks if an
object exists first, before trying to execute methods on it.

Related to: #4781

Co-authored-by: Franck Danard <fdanard@sangoma.com>
2020-07-14 23:17:37 -05:00
..