Protect pointer dereference to avoid a segfault when running headless.
authorpopcornmix <popcornmix@gmail.com>
Sun, 3 Feb 2013 13:51:35 +0000 (13:51 +0000)
committerpopcornmix <popcornmix@gmail.com>
Sun, 3 Feb 2013 13:51:35 +0000 (13:51 +0000)
When using libxbmc.so in a headless setup for library scans, dialog will be NULL. See:
http://forum.xbmc.org/showthread.php?tid=132919&pid=1320914#pid1320914

xbmc/video/VideoInfoScanner.cpp

index fbca835..7f0013d 100644 (file)
@@ -86,7 +86,8 @@ namespace VIDEO
       {
         CGUIDialogExtendedProgressBar* dialog =
           (CGUIDialogExtendedProgressBar*)g_windowManager.GetWindow(WINDOW_DIALOG_EXT_PROGRESS);
-        m_handle = dialog->GetHandle(g_localizeStrings.Get(314));
+        if (dialog)
+           m_handle = dialog->GetHandle(g_localizeStrings.Get(314));
       }
 
       m_bCanInterrupt = true;