Fixed potential NPEs

Signed-off-by: Kai Kreuzer <k.kreuzer@telekom.de>