diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-06-11 17:09:57 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-06-11 17:09:57 +0300 |
commit | 60e5b68c382b6ee894676f8f2da22e4b81696f8c (patch) | |
tree | 130c399ebfa6e152648b32c31ecde8428b92d589 | |
parent | a47f39dd5480dc76550d82bcbfaf5e5a77888d91 (diff) |
Fix for menu V20 item when no tools defined
-rw-r--r-- | src/Display/MenuItem.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Display/MenuItem.cpp b/src/Display/MenuItem.cpp index fc97e2bb..f07f0c72 100644 --- a/src/Display/MenuItem.cpp +++ b/src/Display/MenuItem.cpp @@ -83,7 +83,10 @@ bool MenuItem::IsVisible() const case 7: return reprap.GetGCodes().IsReallyPrinting() || reprap.GetGCodes().IsResuming(); case 10: return reprap.GetPlatform().GetMassStorage()->IsDriveMounted(0); case 11: return !reprap.GetPlatform().GetMassStorage()->IsDriveMounted(0); - case 20: return reprap.GetCurrentOrDefaultTool()->HasTemperatureFault(); + case 20: + { const Tool * const tool = reprap.GetCurrentOrDefaultTool(); // this can be null, especially during startup + return tool != nullptr && tool->HasTemperatureFault(); + } case 28: return reprap.GetHeat().GetStatus(reprap.GetHeat().GetBedHeater(0)) == Heat::HS_fault; } } |