[pdfmod] Fix a crash when the default RegionInfo is null
- From: Gabriel Burt <gburt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pdfmod] Fix a crash when the default RegionInfo is null
- Date: Sat, 27 Mar 2010 02:03:03 +0000 (UTC)
commit 4dbe8cbbc7308fca545641dacfc4cfda320d1e5e
Author: Robert Dyer <psybers gmail com>
Date: Wed Sep 30 15:16:53 2009 -0500
Fix a crash when the default RegionInfo is null
Fixes bgo#596912
Signed-off-by: Gabriel Burt <gabriel burt gmail com>
lib/PdfSharp/PdfSharp.Pdf/PdfPage.cs | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/lib/PdfSharp/PdfSharp.Pdf/PdfPage.cs b/lib/PdfSharp/PdfSharp.Pdf/PdfPage.cs
index 47434ad..e78fa1d 100644
--- a/lib/PdfSharp/PdfSharp.Pdf/PdfPage.cs
+++ b/lib/PdfSharp/PdfSharp.Pdf/PdfPage.cs
@@ -55,7 +55,7 @@ namespace PdfSharp.Pdf
Elements.SetName(Keys.Type, "/Page");
// TODO: Can I get default paper size from something like CultureInfo??
- if (RegionInfo.CurrentRegion.IsMetric)
+ if (RegionInfo.CurrentRegion != null && RegionInfo.CurrentRegion.IsMetric)
Size = PageSize.A4;
else
Size = PageSize.Letter;
@@ -72,7 +72,7 @@ namespace PdfSharp.Pdf
Elements.SetName(Keys.Type, "/Page");
Elements[PdfPage.Keys.Parent] = document.Pages.Reference;
- if (RegionInfo.CurrentRegion.IsMetric)
+ if (RegionInfo.CurrentRegion != null && RegionInfo.CurrentRegion.IsMetric)
Size = PageSize.A4;
else
Size = PageSize.Letter;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]