mirror of
https://github.com/gnosygnu/xowa.git
synced 2024-10-27 20:34:16 +00:00
Category: Fix fatal page load error when page_cat_db_id is invalid
This commit is contained in:
parent
8c31c8fd62
commit
19b2d6226c
@ -49,8 +49,9 @@ class Xoctg_pagebox_loader implements Select_in_cbk {
|
|||||||
|
|
||||||
// select
|
// select
|
||||||
attach_mgr.Attach();
|
attach_mgr.Attach();
|
||||||
Db_rdr rdr = cat_link_conn.Stmt_sql(sql).Exec_select__rls_auto();
|
Db_rdr rdr = Db_rdr_.Empty;
|
||||||
try {
|
try {
|
||||||
|
rdr = cat_link_conn.Stmt_sql(sql).Exec_select__rls_auto();
|
||||||
while (rdr.Move_next()) {
|
while (rdr.Move_next()) {
|
||||||
Xoa_ttl ttl = wiki.Ttl_parse(rdr.Read_int("page_namespace"), rdr.Read_bry_by_str("page_title"));
|
Xoa_ttl ttl = wiki.Ttl_parse(rdr.Read_int("page_namespace"), rdr.Read_bry_by_str("page_title"));
|
||||||
// check if ttl exists already in hash; add it if not; check is not needed now b/c html_dbs will never put itms in hash, but may need in future if merging "wtxt" and "ctgs_dbs"
|
// check if ttl exists already in hash; add it if not; check is not needed now b/c html_dbs will never put itms in hash, but may need in future if merging "wtxt" and "ctgs_dbs"
|
||||||
@ -60,6 +61,9 @@ class Xoctg_pagebox_loader implements Select_in_cbk {
|
|||||||
itm.Load_by_db(rdr.Read_int("cl_to_id"), DateAdp_.unixtime_utc_ms_(rdr.Read_long("cl_timestamp_unix")));
|
itm.Load_by_db(rdr.Read_int("cl_to_id"), DateAdp_.unixtime_utc_ms_(rdr.Read_long("cl_timestamp_unix")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
Gfo_usr_dlg_.Instance.Warn_many("", "", "category.pagebox: fatal error while retrieving categories; page=~{0} err=~{1}", page_id, Err_.Message_gplx_log(e));
|
||||||
|
}
|
||||||
finally {
|
finally {
|
||||||
rdr.Rls();
|
rdr.Rls();
|
||||||
attach_mgr.Detach();
|
attach_mgr.Detach();
|
||||||
|
Loading…
Reference in New Issue
Block a user