fixes bug: frontend hangs if there is no data from server

just checks data exists before trying to push it to the view. fixes a small bug