anekos / Ank-Pixiv-Tool

An extension which supports one-click downloads of illustrations from Pixiv. It's able to choose automatically appropriate file names. It also supports full screen view of large illustrations on medium-sized screens.
136 stars 71 forks source link

起動時にstorageでnull例外 #25

Closed ginzu closed 11 years ago

ginzu commented 11 years ago

■現象

・起動時にコンソールに次ようなメッセージが記録されます。

<<ANK<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
[TypeError]
  message: Components.classes[klass] is undefined
  filename: chrome://ankpixiv/content/ankutils.js
  linenumber: 359
  stack: AnkUtils.ccci@chrome://ankpixiv/content/ankutils.js:359
AnkStorage.prototype.tableInfo@chrome://ankpixiv/content/ankstorage.js:200
AnkStorage.prototype.updateTable@chrome://ankpixiv/content/ankstorage.js:214
AnkStorage.prototype.createTable@chrome://ankpixiv/content/ankstorage.js:186
AnkStorage.prototype.createTables@chrome://ankpixiv/content/ankstorage.js:170
AnkStorage@chrome://ankpixiv/content/ankstorage.js:29
initStorage@chrome://ankpixiv/content/ankpixiv.js:2039
AnkPixiv.onInit@chrome://ankpixiv/content/ankpixiv.js:2047
@chrome://ankpixiv/content/ankpixiv.xul:18

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

■原因

・これでしょうか。

Components.classes["@mozilla.org/storage/statement-wrapper;1"]

■ローカルでの応急対処

・以下のようにしてみました。

(AnkStorage.prototype.tableInfo@chrome://ankpixiv/content/ankstorage.js:200 )

    tableInfo: function (tableName) { // {{{
      let q = 'pragma table_info (' + tableName + ')';
      return this.createStatement(q, function (stmt) {
        let result = {};
        while (stmt.executeStep()) {
          result[stmt.row["name"]] = {type: stmt.row["type"]};
        }
        return result;
      });
    }, // }}}

■再現環境

FF22.0+1.18.3

anekos commented 11 years ago

ありがとうございます!対応しました。