Fix issue found by sonar: Method call on object which may be null

Change-Id: I937dddbe08fa12cbe38ad01a5990a90c4ac19df1
Signed-off-by: Flavio Fernandes <ffernand@redhat.com>
Merge "Fix issue found by sonar: Method call on object which may be null"