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

Unified Diff: tools/fiddle/fiddle_main.cpp

Issue 2292343003: GN: add sources_when_disabled to optional (Closed)
Patch Set: Created 4 years, 4 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 | « BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/fiddle/fiddle_main.cpp
diff --git a/tools/fiddle/fiddle_main.cpp b/tools/fiddle/fiddle_main.cpp
index bf6a8c27d5fae86f43a0b8bd46626d7a1e694449..0fa61586663073835e4317a9649d227d3d393089 100644
--- a/tools/fiddle/fiddle_main.cpp
+++ b/tools/fiddle/fiddle_main.cpp
@@ -136,10 +136,12 @@ int main() {
if (options.pdf) {
SkDynamicMemoryWStream pdfStream;
sk_sp<SkDocument> document(SkDocument::MakePDF(&pdfStream));
- srand(0);
- draw(document->beginPage(options.size.width(), options.size.height()));
- document->close();
- pdfData.reset(pdfStream.copyToData());
+ if (document) {
+ srand(0);
+ draw(document->beginPage(options.size.width(), options.size.height()));
+ document->close();
+ pdfData.reset(pdfStream.copyToData());
+ }
}
if (options.skp) {
SkSize size;
« no previous file with comments | « BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698