[silme] Entity.getValue() crashes on empty fallback list

RESOLVED FIXED

Status

Mozilla Localizations
Infrastructure
--
blocker
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: adriank, Assigned: adriank)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

9 years ago
Created attachment 349091 [details] [diff] [review]
patch fixing the crash by checking for empty lists

silme.core.entity.Entity.getValue() crashes if it gets an empty list as fallback. Unfortunately: that's exactly the default value for L10nObjects and EntityLists.

I think there are two ways of fixing this problem:
1) check for empty lists in Entity.getValue() (like in the attached patch)
2) change the default value of L10nObject.fallback and EntityList.fallback from "[]" to "None"
I think I prefer L10nObject.fallback=None patch :)
(Assignee)

Comment 2

9 years ago
Created attachment 349269 [details] [diff] [review]
change default fallback values
Attachment #349091 - Attachment is obsolete: true
Attachment #349269 - Flags: review?(gandalf)
(Assignee)

Updated

9 years ago
Attachment #349269 - Attachment is obsolete: true
Attachment #349269 - Flags: review?(gandalf)
(Assignee)

Comment 3

9 years ago
changing "L10nObject.fallback=[]" to "L10nObject.fallback=None" results in crashes. I'll need to investigate more to find a good solution for that problem.
(Assignee)

Comment 4

9 years ago
Created attachment 349507 [details] [diff] [review]
change default fallback values and adjust parsers for that change

this patch works without crashes
Assignee: nobody → akalla
Status: NEW → ASSIGNED
Attachment #349507 - Flags: review?(gandalf)
Attachment #349507 - Flags: review?(gandalf) → review+
Comment on attachment 349507 [details] [diff] [review]
change default fallback values and adjust parsers for that change

good
commited
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
Blocks: 478225
You need to log in before you can comment on or make changes to this bug.