Fix leafTypeName returning names of primitive types

This means describe won't tell me
"example-schema:leaf: string (a string)", but just
"example-schema:leaf: (a string)".

Change-Id: I736bf655f3301a61b76485b15cf123448459047e
diff --git a/src/yang_schema.cpp b/src/yang_schema.cpp
index 6021cc5..132c25f 100644
--- a/src/yang_schema.cpp
+++ b/src/yang_schema.cpp
@@ -304,7 +304,7 @@
 std::optional<std::string> YangSchema::leafTypeName(const std::string& path) const
 {
     libyang::Schema_Node_Leaf leaf(getSchemaNode(path));
-    return leaf.type()->der().get() ? std::optional{leaf.type()->der()->name()} : std::nullopt;
+    return leaf.type()->der().get() && leaf.type()->der()->type()->der().get() ? std::optional{leaf.type()->der()->name()} : std::nullopt;
 }
 
 std::string YangSchema::leafrefPath(const std::string& leafrefPath) const