From ebb6709966e6c8cf28e04863700ab29e64b4386f Mon Sep 17 00:00:00 2001 From: David Bailes Date: Fri, 29 May 2015 19:57:49 +0100 Subject: [PATCH] fix for state in status bar. For linux, there was a missing include, and there was also an invalid use of a pointer. Fixes for both kindly supplied by Leland. --- src/toolbars/ControlToolBar.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/toolbars/ControlToolBar.cpp b/src/toolbars/ControlToolBar.cpp index 537d25a6a..e602e221d 100644 --- a/src/toolbars/ControlToolBar.cpp +++ b/src/toolbars/ControlToolBar.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include #endif #include @@ -1083,7 +1084,11 @@ void ControlToolBar::ClearCutPreviewTracks() // works out the width of the field in the status bar needed for the state (eg play, record pause) int ControlToolBar::WidthForStatusBar() { - wxStatusBar* sb = GetActiveProject()->GetStatusBar(); + AudacityProject* p = GetActiveProject(); + if (!p) + return 100; // dummy value to keep things happy before the project is fully created + + wxStatusBar* sb = p->GetStatusBar(); int xMax = 0; int x, y;