Just a case of uninitialized material array. Make sure object materials are initialized properly when drawing UVs. This might look strange since we do not really need materials here. However, the same GPU object may be used in a 3D viewport and if we try to avoid initializing the materials somehow this will break. Also, this breaks on full screen UV editor as is apparent from this report.