mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-16 11:42:12 +08:00
Some more safety against possible access violation in StatusBarDrawPanel. Fixes issue #2418
This commit is contained in:
@ -1060,13 +1060,17 @@ procedure TMainForm.StatusBarDrawPanel(StatusBar: TStatusBar; Panel: TStatusPane
|
|||||||
var
|
var
|
||||||
PanelRect: TRect;
|
PanelRect: TRect;
|
||||||
ImageIndex: Integer;
|
ImageIndex: Integer;
|
||||||
|
Conn: TDBConnection;
|
||||||
begin
|
begin
|
||||||
// Refresh one status bar panel, probably with icon
|
// Refresh one status bar panel, probably with icon
|
||||||
ImageIndex := -1;
|
ImageIndex := -1;
|
||||||
case Panel.Index of
|
case Panel.Index of
|
||||||
2: ImageIndex := 149;
|
2: ImageIndex := 149;
|
||||||
3: if (FActiveDbObj <> nil) and (Assigned(FActiveDbObj.Connection)) then
|
3: begin
|
||||||
ImageIndex := FActiveDbObj.Connection.Parameters.ImageIndex;
|
Conn := ActiveConnection;
|
||||||
|
if Conn <> nil then
|
||||||
|
ImageIndex := Conn.Parameters.ImageIndex;
|
||||||
|
end;
|
||||||
6: begin
|
6: begin
|
||||||
if Panel.Text = SIdle then
|
if Panel.Text = SIdle then
|
||||||
ImageIndex := 151 // Green dot
|
ImageIndex := 151 // Green dot
|
||||||
|
Reference in New Issue
Block a user