[librsvg: 7/9] NodeUse: Log when referencing a nonexistent element



commit 033da1d1a3654869a383ca99f8da569701299926
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Oct 24 11:45:56 2018 -0500

    NodeUse: Log when referencing a nonexistent element

 rsvg_internals/src/structure.rs | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/rsvg_internals/src/structure.rs b/rsvg_internals/src/structure.rs
index 1965f176..f384413e 100644
--- a/rsvg_internals/src/structure.rs
+++ b/rsvg_internals/src/structure.rs
@@ -295,12 +295,19 @@ impl NodeTrait for NodeUse {
             return Ok(());
         }
 
-        let child = if let Some(acquired) = draw_ctx.get_acquired_node(link.as_ref().unwrap()) {
+        let uri = link.as_ref().unwrap();
+
+        let child = if let Some(acquired) = draw_ctx.get_acquired_node(uri) {
             // Here we clone the acquired child, so that we can drop the AcquiredNode as
             // early as possible.  This is so that the child's drawing method will be able
             // to re-acquire the child for other purposes.
             acquired.get().clone()
         } else {
+            rsvg_log!(
+                "element {} references nonexistent \"{}\"",
+                node.get_human_readable_name(),
+                uri,
+            );
             return Ok(());
         };
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]