prevent arrayResult.forEach of null error

Detected error: TypeError: Cannot call method 'forEach' of null