From 23d67624cdebf5b25ed446ad52f6cd1cddebe34d Mon Sep 17 00:00:00 2001 From: cku Date: Mon, 18 Sep 2017 23:55:54 +0800 Subject: [PATCH] Bug 1401069 - Part 8. Give a detailed comment to explain how to react when hitting this assertion in OpenDocument(). r=fatseng MozReview-Commit-ID: 74UkMV3ZOWm --HG-- extra : rebase_source : 5fedf61f8a737ecac5668d372bff48b224859fdb --- widget/windows/PDFViaEMFPrintHelper.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/widget/windows/PDFViaEMFPrintHelper.cpp b/widget/windows/PDFViaEMFPrintHelper.cpp index 6721c544ce5e..de7a4ac756a9 100644 --- a/widget/windows/PDFViaEMFPrintHelper.cpp +++ b/widget/windows/PDFViaEMFPrintHelper.cpp @@ -37,8 +37,11 @@ nsresult PDFViaEMFPrintHelper::OpenDocument(nsIFile *aFile) { MOZ_ASSERT(aFile); + if (mPDFDoc) { - MOZ_ASSERT_UNREACHABLE("We can only open one PDF at a time"); + MOZ_ASSERT_UNREACHABLE("We can only open one PDF at a time," + "Use CloseDocument() to close the opened file" + "before calling OpenDocument()"); return NS_ERROR_FAILURE; }