Fixed a null pointer exception when loading previous resources