From d9e254533a121dc86bce212795536f28155d066c Mon Sep 17 00:00:00 2001
From: Rodrigo Braz Monteiro <zeratul@cellosoft.com>
Date: Thu, 6 Mar 2008 23:41:27 +0000
Subject: [PATCH] Hopefully fixed a crash with mouse wheel on associations
 Window.

Originally committed to SVN as r1936.
---
 aegisub/main.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/aegisub/main.cpp b/aegisub/main.cpp
index 5cfb040ad..ab78a5052 100644
--- a/aegisub/main.cpp
+++ b/aegisub/main.cpp
@@ -93,6 +93,7 @@ void StartupLog(const wxString &msg) {
 // Gets called when application starts, creates MainFrame
 bool AegisubApp::OnInit() {
 	StartupLog(_T("Inside OnInit"));
+	frame = NULL;
 	try {
 		// Initialize randomizer
 		StartupLog(_T("Initialize random generator"));
@@ -409,7 +410,7 @@ END_EVENT_TABLE()
 void AegisubApp::OnMouseWheel(wxMouseEvent &event) {
 	wxPoint pt;
 	wxWindow *target = wxFindWindowAtPointer(pt);
-	if (target == frame->audioBox->audioDisplay || target == frame->SubsBox) {
+	if (frame && (target == frame->audioBox->audioDisplay || target == frame->SubsBox)) {
 		if (target->IsShownOnScreen()) target->AddPendingEvent(event);
 		else event.Skip();
 	}
-- 
GitLab