diff --git a/Assets/Scripts/PropositionFrame.cs b/Assets/Scripts/PropositionFrame.cs index f0d76a4..c5313b9 100644 --- a/Assets/Scripts/PropositionFrame.cs +++ b/Assets/Scripts/PropositionFrame.cs @@ -22,8 +22,10 @@ public void Initialize(Proposition _proposition) { Debug.Log($"Initializing {_proposition.owner}'s proposition", this); proposition = _proposition; - DisplayPicture(proposition.photoUrl); playerName.text = proposition.owner.name; + + if (!string.IsNullOrEmpty(proposition.photoUrl)) + DisplayPicture(proposition.photoUrl); } private void DisplayPicture(string _url) diff --git a/Assets/Scripts/VotingPage.cs b/Assets/Scripts/VotingPage.cs index 04043ee..78b762d 100644 --- a/Assets/Scripts/VotingPage.cs +++ b/Assets/Scripts/VotingPage.cs @@ -88,8 +88,22 @@ void ShowQuestion() Debug.Log($"Prompt is {currentPromptLabel.text}", this); - proposition1.Initialize(currentQuestion.propositions[0]); - proposition1.Initialize(currentQuestion.propositions[1]); + if (currentQuestion.propositions[0] != null) + proposition1.Initialize(currentQuestion.propositions[0]); + else + { + Debug.Log("User has given no proposition", this); + //manage if there is no proposition + } + + if (currentQuestion.propositions[1] != null) + proposition2.Initialize(currentQuestion.propositions[1]); + else + { + Debug.Log("User has given no proposition", this); + //manage if there is no proposition + } + endOfTimer = DateTime.Now.AddSeconds(votingTime); }