Fix potential NPE in Scanner.

Refer to RPM spec[1], some tags could be optional.

[1] http://refspecs.linuxbase.org/LSB_4.1.0/LSB-Core-generic/LSB-Core-generic/pkgformat.html