Kaydet (Commit) 2ff6afcc authored tarafından Christian Lohmaier's avatar Christian Lohmaier

tdf#89215 only process state changes after TileProvider is ready

otherwise the handling tries to access properties like fonts too early
and trigger NPEs

Change-Id: I132c02f936c7b3e70fced1e1e022a6cf803ed5ff
üst daa254b7
......@@ -239,7 +239,10 @@ public class InvalidationHandler implements Document.MessageCallback, Office.Mes
}
final String value = parts[1];
boolean pressed = Boolean.parseBoolean(value);
if (!mContext.getTileProvider().isReady()) {
Log.w(LOGTAG, "tile provider not ready, ignoring payload "+payload);
return;
}
if (parts[0].equals(".uno:Bold")) {
mContext.getFormattingController().onToggleStateChanged(Document.BOLD, pressed);
} else if (parts[0].equals(".uno:Italic")) {
......
......@@ -719,6 +719,10 @@ public class LibreOfficeMainActivity extends AppCompatActivity implements Settin
mTileProvider = loKitTileProvider;
}
public LOKitTileProvider getTileProvider() {
return mTileProvider;
}
public void savePassword(String pwd) {
mPassword = pwd;
synchronized (mTileProvider.getMessageCallback()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment