ra4king / CircuitSim

Basic Circuit Simulator
https://ra4king.github.io/CircuitSim
BSD 3-Clause "New" or "Revised" License
76 stars 27 forks source link

Throw a slightly more friendly message when a student opens an empty file #99

Open ausbin opened 11 months ago

ausbin commented 11 months ago

This error gets propagated to autograders, so a more friendly error message is useful

The current behavior is this, which confuses students:

java.lang.NullPointerException: Cannot read field "circuits" because "circuitFile" is null
    at com.ra4king.circuitsim.gui.CircuitSim.lambda$loadCircuits$57(CircuitSim.java:1477)
    at java.base/java.lang.Thread.run(Thread.java:833)