Change condition to check also variable which could be null. Reviewed-By: Petr Vobornik <pvoborni@redhat.com>