From f67a67798629a4b6d67219efe919b3c827fa32ab Mon Sep 17 00:00:00 2001 From: Murai Takashi Date: Sun, 26 Jan 2020 20:23:16 +0900 Subject: [PATCH] soundrecorder: Fix PVS V595 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add NULL check for 'fBitmap', since it might be NULL at line 71. Change-Id: I70bf4d29e20bbe1c62d972f576dc52d4783933d1 Reviewed-on: https://review.haiku-os.org/c/haiku/+/2169 Reviewed-by: Jérôme Duval --- src/apps/soundrecorder/TrackSlider.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/apps/soundrecorder/TrackSlider.cpp b/src/apps/soundrecorder/TrackSlider.cpp index 9cbb606906..8689e5d4e0 100644 --- a/src/apps/soundrecorder/TrackSlider.cpp +++ b/src/apps/soundrecorder/TrackSlider.cpp @@ -64,13 +64,14 @@ TrackSlider::AttachedToWindow() void TrackSlider::_InitBitmap() { - if (fBitmapView) { - fBitmap->RemoveChild(fBitmapView); - delete fBitmapView; - } - if (fBitmap) + if (fBitmap != NULL) { + if (fBitmapView != NULL) { + fBitmap->RemoveChild(fBitmapView); + delete fBitmapView; + } delete fBitmap; - + } + BRect rect = Bounds(); fBitmap = new BBitmap(rect, BScreen().ColorSpace(), true);