Fix potential NullPointerException
Fixing a NullPointerException occuring on null-results in some
libraries.