Fixes bug where courses result could be null and if so it would cause a javascript error