webadmin: fixed Coverity Scan errors

removed some NPE vulnerabilities and unchecked casts

Change-Id: I9e3a6438f23c530e637d557039131442ea3a73e3
Signed-off-by: Tomas Jelinek <tjelinek@redhat.com>