morinted / schedule-generator

A schedule generator for the University of Ottawa written in Java, using OCSF.
63 stars 19 forks source link

NullPointerException if stdin not available #52

Open davidschlachter opened 4 years ago

davidschlachter commented 4 years ago

If the server is started in a situation where there is no stdin (e.g. from cron or rc.d), the following error is raised:

Unexpected error while reading from console!
java.lang.NullPointerException
    at ca.uottawa.ui.ScheduleGeneratorServer.handleMessageFromServerUI(ScheduleGeneratorServer.java:267)
    at ca.uottawa.ui.ServerConsole.accept(ServerConsole.java:67)
    at ca.uottawa.ui.ServerConsole.main(ServerConsole.java:121)

While this doesn't appear to affect the operation of the program, it would be nice to clean up.