Fixes crash if resourceJSON is nil.