Fix error when schema is null (disconnected backup and restore)

In disconnected scenarios during backup and restore schema can be null, this must be checked