Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1731)

Unified Diff: core/src/fpdfdoc/doc_annot.cpp

Issue 361553002: Remove "this==NULL" and adjust corresponding callers (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: fix if check warning Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp ('k') | core/src/fpdfdoc/doc_ap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfdoc/doc_annot.cpp
diff --git a/core/src/fpdfdoc/doc_annot.cpp b/core/src/fpdfdoc/doc_annot.cpp
index 227578a974ffbe035668fd86a4b499487d6cf66c..89528455701f41f510b95c180ed4aaaffa5a364a 100644
--- a/core/src/fpdfdoc/doc_annot.cpp
+++ b/core/src/fpdfdoc/doc_annot.cpp
@@ -165,7 +165,7 @@ void CPDF_Annot::ClearCachedAP()
}
CFX_ByteString CPDF_Annot::GetSubType() const
{
- return m_pAnnotDict->GetConstString(FX_BSTRC("Subtype"));
+ return m_pAnnotDict ? m_pAnnotDict->GetConstString(FX_BSTRC("Subtype")) : CFX_ByteStringC();
}
void CPDF_Annot::GetRect(CPDF_Rect& rect) const
{
@@ -202,7 +202,8 @@ CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict, CPDF_Annot::Appeara
if (as.IsEmpty()) {
CFX_ByteString value = pAnnotDict->GetString(FX_BSTRC("V"));
if (value.IsEmpty()) {
- value = pAnnotDict->GetDict(FX_BSTRC("Parent"))->GetString(FX_BSTRC("V"));
+ CPDF_Dictionary* pDict = pAnnotDict->GetDict(FX_BSTRC("Parent"));
+ value = pDict ? pDict->GetString(FX_BSTRC("V")) : CFX_ByteString();
}
if (value.IsEmpty() || !((CPDF_Dictionary*)psub)->KeyExist(value)) {
as = FX_BSTRC("Off");
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp ('k') | core/src/fpdfdoc/doc_ap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698