diff --git a/android/src/main/java/com/horcrux/svg/VirtualNode.java b/android/src/main/java/com/horcrux/svg/VirtualNode.java
index <HASH>..<HASH> 100644
--- a/android/src/main/java/com/horcrux/svg/VirtualNode.java
+++ b/android/src/main/java/com/horcrux/svg/VirtualNode.java
@@ -317,7 +317,9 @@ abstract class VirtualNode extends LayoutShadowNode {
 
         ReactShadowNode parent = getParent();
 
-        if (parent instanceof SvgViewShadowNode) {
+        if (parent == null) {
+            return null;
+        } else if (parent instanceof SvgViewShadowNode) {
             mSvgShadowNode = (SvgViewShadowNode)parent;
         } else if (parent instanceof VirtualNode) {
             mSvgShadowNode = ((VirtualNode) parent).getSvgShadowNode();
Fix null handling of getSvgShadowNode in new ancestor creation