|
@@ -40,7 +40,7 @@ public class TaskPhotoPanel : MonoBehaviour
|
|
|
|
|
|
public void Next()
|
|
|
{
|
|
|
- if (currentIndex < task_item.files.Length - 1)
|
|
|
+ if (task_item is { files: not null } && currentIndex < task_item.files.Length - 1)
|
|
|
{
|
|
|
currentIndex++;
|
|
|
ChangePage(currentIndex);
|
|
@@ -49,7 +49,7 @@ public class TaskPhotoPanel : MonoBehaviour
|
|
|
|
|
|
public void Last()
|
|
|
{
|
|
|
- if (currentIndex > 0)
|
|
|
+ if (task_item is { files: not null } &¤tIndex > 0)
|
|
|
{
|
|
|
currentIndex--;
|
|
|
ChangePage(currentIndex);
|
|
@@ -59,7 +59,7 @@ public class TaskPhotoPanel : MonoBehaviour
|
|
|
public void ChangePage(int pageIndex)
|
|
|
{
|
|
|
img.texture = null;
|
|
|
- if (task_item.files.Length < 1)
|
|
|
+ if (task_item?.files == null || task_item.files.Length < 1)
|
|
|
{
|
|
|
pageText.text = $"0/0";
|
|
|
return;
|