Run time error when retrieving JSON data

The line val photoResponse: PhotoResponse? = flickrResponse?.photos

in listing 24.27 fails with an UnitializedPropertyAccessException: lateinit property photos has not being initialized.

Is something missing from the code in Chapter 24?

Have you checked your values?