From 72ecc8e66c4fdfde2f0bcca2601df679e4bf79a5 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sun, 17 Mar 2019 22:53:40 -0400 Subject: [PATCH] quick fix to stop OSD from crashing if we try to print a line to the OSD before the frontend is fully initialized --- desmume/src/driver.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/desmume/src/driver.cpp b/desmume/src/driver.cpp index 7534ef0ae..8fe9a7d5f 100644 --- a/desmume/src/driver.cpp +++ b/desmume/src/driver.cpp @@ -52,6 +52,7 @@ BaseDriver::~BaseDriver() void BaseDriver::AddLine(const char *fmt, ...) { #if HAVE_LIBAGG + if(!osd) return; va_list list; va_start(list,fmt); osd->addLine(fmt,list); @@ -61,6 +62,7 @@ void BaseDriver::AddLine(const char *fmt, ...) void BaseDriver::SetLineColor(u8 r, u8 b, u8 g) { #if HAVE_LIBAGG + if(!osd) return; osd->setLineColor(r,b,g); #endif }