Fix PPT disconnect null check crash (#413)
This commit is contained in:
@@ -1344,10 +1344,22 @@ namespace Ink_Canvas.Helpers
|
|||||||
catch { }
|
catch { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static bool IsObjectNull(object comObject)
|
||||||
|
{
|
||||||
|
return ReferenceEquals(comObject, null);
|
||||||
|
}
|
||||||
|
|
||||||
private void DisconnectFromPPT()
|
private void DisconnectFromPPT()
|
||||||
{
|
{
|
||||||
if (PPTApplication == null && _pptActivePresentation == null && _pptSlideShowWindow == null &&
|
object pptApplication = PPTApplication;
|
||||||
CurrentPresentation == null && CurrentSlides == null && CurrentSlide == null)
|
object activePresentation = _pptActivePresentation;
|
||||||
|
object slideShowWindow = _pptSlideShowWindow;
|
||||||
|
object currentPresentation = CurrentPresentation;
|
||||||
|
object currentSlides = CurrentSlides;
|
||||||
|
object currentSlide = CurrentSlide;
|
||||||
|
|
||||||
|
if (IsObjectNull(pptApplication) && IsObjectNull(activePresentation) && IsObjectNull(slideShowWindow) &&
|
||||||
|
IsObjectNull(currentPresentation) && IsObjectNull(currentSlides) && IsObjectNull(currentSlide))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user