[webapp] Added some nil checks

Signed-off-by: Juha Kallioinen <juha.kallioinen@jolla.com>