summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfannot.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-01-10 20:57:15 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-10 20:57:15 +0000
commit4afee170f5e26b044236fd1e93c6ae2371a993de (patch)
treec7d7e15bf3909a4bf2a7477cbacc373f4eca99e7 /fpdfsdk/fpdfannot.cpp
parent3ffde1bc73156098e78e5e303b3f5198a1d073b8 (diff)
downloadpdfium-4afee170f5e26b044236fd1e93c6ae2371a993de.tar.xz
Fix some nits from commit a74e75d.
Change-Id: Ib4556ac75efafee5a2566ad76acd87883303660f Reviewed-on: https://pdfium-review.googlesource.com/22679 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfannot.cpp')
-rw-r--r--fpdfsdk/fpdfannot.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/fpdfsdk/fpdfannot.cpp b/fpdfsdk/fpdfannot.cpp
index c7433d03d8..e40e21981e 100644
--- a/fpdfsdk/fpdfannot.cpp
+++ b/fpdfsdk/fpdfannot.cpp
@@ -767,11 +767,8 @@ FPDFAnnot_GetAP(FPDF_ANNOTATION annot,
static_cast<CPDF_Annot::AppearanceMode>(appearanceMode);
CPDF_Stream* pStream = FPDFDOC_GetAnnotAPNoFallback(pAnnotDict, mode);
- if (!pStream)
- return Utf16EncodeMaybeCopyAndReturnLength(L"", buffer, buflen);
-
- return Utf16EncodeMaybeCopyAndReturnLength(pStream->GetUnicodeText(), buffer,
- buflen);
+ return Utf16EncodeMaybeCopyAndReturnLength(
+ pStream ? pStream->GetUnicodeText() : L"", buffer, buflen);
}
FPDF_EXPORT FPDF_ANNOTATION FPDF_CALLCONV