Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty sections in YAML config cause NullPointerExceptions #23

Closed
fxkr opened this issue Apr 10, 2013 · 2 comments
Closed

Empty sections in YAML config cause NullPointerExceptions #23

fxkr opened this issue Apr 10, 2013 · 2 comments
Assignees
Labels

Comments

@fxkr
Copy link

fxkr commented Apr 10, 2013

Valid YAML file:

mixer:

hardware:
    device: "/dev/ttyUSB0"

Code to load it:

Configuration.load("config.yaml", YAMLFormat)

Traceback:

Exception in thread "main" java.lang.NullPointerException
    at org.streum.configrity.yaml.YAMLFormat$.org$streum$configrity$yaml$YAMLFormat$$readValue(YAMLFormat.scala:70)
    at org.streum.configrity.yaml.YAMLFormat$$anonfun$readMap$1.apply(YAMLFormat.scala:62)
    at org.streum.configrity.yaml.YAMLFormat$$anonfun$readMap$1.apply(YAMLFormat.scala:61)
    at scala.collection.TraversableOnce$$anonfun$foldLeft$1.apply(TraversableOnce.scala:144)
    at scala.collection.TraversableOnce$$anonfun$foldLeft$1.apply(TraversableOnce.scala:144)
    at scala.collection.immutable.Map$Map3.foreach(Map.scala:154)
    at scala.collection.TraversableOnce$class.foldLeft(TraversableOnce.scala:144)
    at scala.collection.AbstractTraversable.foldLeft(Traversable.scala:105)
    at org.streum.configrity.yaml.YAMLFormat$.readMap(YAMLFormat.scala:61)
    at org.streum.configrity.yaml.YAMLFormat$.yaml2map(YAMLFormat.scala:52)
    at org.streum.configrity.yaml.YAMLFormat$.fromText(YAMLFormat.scala:34)
    at org.streum.configrity.Configuration$.load(Configuration.scala:231)
    at org.streum.configrity.Configuration$.load(Configuration.scala:246)
    at my.code.Blub$.load(Config.scala:132)
@ghost ghost assigned paradigmatic Apr 12, 2013
@paradigmatic
Copy link
Owner

I have some time left to improve Configrity. Sorry for the long delay. I will try to fix this bug very soon.

@paradigmatic
Copy link
Owner

Bug is fixed in last commit. In YAML parsing, any key with an empty value will be ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants