1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

Embeddable: Handler null pointer exceptions for <gallery> when no de.wikipedia.org-file-core.xowa file is available

This commit is contained in:
gnosygnu
2017-06-06 22:05:28 -04:00
parent e687f23586
commit c2dca930f3
7 changed files with 17 additions and 6 deletions

View File

@@ -234,6 +234,7 @@ public class Swt_kit implements Gfui_kit {
public Gfui_dlg_msg New_dlg_msg(String msg) {return new Swt_dlg_msg(shell).Init_msg_(msg);}
public ImageAdp New_img_load(Io_url url) {
if (url == Io_url_.Empty) return ImageAdp_.Null;
if (!Io_mgr.Instance.Exists(url)) return ImageAdp_.Null; // must check if exists or fatal error; DATE:2017-06-02
Image img = new Image(display, url.Raw());
Rectangle rect = img.getBounds();
return new Swt_img(this, img, rect.width, rect.height).Url_(url);

View File

@@ -69,7 +69,9 @@ public class Swt_btn_no_border implements GxwElem, Swt_control {
// note can't use width, b/c search_exec_btn somehow goes from 16px to 20px
if (v.Size().Height() != size.Height())
v = v.Resize(size.Width(), size.Height());
box_btn.setImage(Copy_w_transparency((Image)v.Under()));
if ((v.Under() instanceof Image)) { // check needed else will fail when image doesn't exist; DATE:2017-06-03
box_btn.setImage(Copy_w_transparency((Image)v.Under()));
}
}
private Image Copy_w_transparency(Image src) {
// set transparency