Bug #2467

Duktape typeerrors on page.appendItem if url is undefined (null)

Added by Leonid Protasov almost 6 years ago. Updated almost 6 years ago.

Status:RejectedStart date:01/07/2015
Priority:NormalDue date:
Assignee:Andreas Smas% Done:

0%

Category:Ecmascript & Duktape
Target version:4.10
Found in version:4.9.33 Platform:Linux

Description

The code:

                    page.appendItem(url, 'video', {
                    title: new showtime.RichText(json.items[i].title + colorStr(bytesToSize(json.items[i].fileSize ? json.items[i].fileSize : json.items[i].quotaBytesUsed), blue) + ' ' + dateToHuman(json.items[i].modifiedDate)),
                        icon: json.items[i].thumbnailLink ? json.items[i].thumbnailLink : json.items[i].iconLink
                });

url = undefined (null) makes:

gdrive          [ERROR]: TypeError (invalid base value) at showtime/page:237
gdrive          [ERROR]: STACK DUMP: TypeError: invalid base value
                             duk_hobject_props.c:2034
                             anon showtime/page:237
                             processJSON file:///root/showtime-plugins/gdrive/gdrive.js:219
                             ls file:///root/showtime-plugins/gdrive/gdrive.js:226
                             anon file:///root/showtime-plugins/gdrive/gdrive.js:184 preventsyield
                             apply  native strict preventsyield
                             anon showtime/page:349 preventsyield

History

#1 Updated by Andreas Smas almost 6 years ago

  • Status changed from New to Rejected

Use appendPassiveItem if you don't have an URL

#2 Updated by Leonid Protasov almost 6 years ago

Andreas Ă–man wrote:

Use appendPassiveItem if you don't have an URL

I will light the details why I raised this:
In gdrive plugin which was working flawlessy on duktape before - today and got that error. That is because google decided to send empty urls in json for built in file types like spreadsheets etc.

So rewriting plugins just because url become empty seems to be less logically then to make api v1 be empty url proof.

I made follwing change in the plugin code: var url = ''; if (json.value) url = json.value;
But IMHO its better to fix that internally.

Also available in: Atom PDF