Skip to content

Commit

Permalink
Merge pull request #528 from H-chauvet/hotfix/null
Browse files Browse the repository at this point in the history
[ADD] Check imagesUrl null
  • Loading branch information
tbellicha authored Nov 21, 2024
2 parents a1676f8 + 71fcda8 commit 0652cc1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Application/mobile/app_code/lib/pages/rent/rent_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,9 @@ class RentArticlePageState extends State<RentArticlePage> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(height: 8),
loadImageFromURL(_articleData.imagesUrl?[0]),
loadImageFromURL(_articleData.imagesUrl!.isNotEmpty
? _articleData.imagesUrl![0]
: null),
const SizedBox(height: 8),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
Expand Down
1 change: 1 addition & 0 deletions Application/mobile/app_code/test/rent_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ void main() {
price: 3,
status: Status.GOOD,
categories: [],
imagesUrl: [],
),
),
),
Expand Down
2 changes: 1 addition & 1 deletion Server/fixtures/mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ exports.createFixtures = async () => {
},
{
id: 4,
name: "Freesbee",
name: "Frisbee",
price: 1.5,
available: true,
categories: {
Expand Down

0 comments on commit 0652cc1

Please sign in to comment.