When reloading resources after context loss, it is possible for
some of the resources to have already been destroyed, but still
be in the map in the image factory. In this case the search
for the ResourceTicket returns a NULL pointer which should be
checked for.
Change-Id: I967e7e07021903ad57d9a1617295bf94f16b53b6
ResourceTicketPtr ticket = mResourceClient.RequestResourceTicket( request->resourceId );
// do not reload if still loading
- if ( ticket->GetLoadingState() != ResourceLoading )
+ // check ticket is not NULL as the resource could have already been destroyed
+ if ( ticket && ticket->GetLoadingState() != ResourceLoading )
{
// Ensure the finished status is reset
mResourceClient.ReloadResource( ticket->GetId(), true );