QML UI: Add various checks for undefined / null objects

Signed-off-by: Nelson Ferreira <nelson.ferreira@ieee.org>
Initial patch

Signed-off-by: Thomas Perl <m@thp.io>
Changed JavaScript null inequality operator (!= null) to !== null