archi-contribs / database-plugin

Database export/import plugin that store models in a central database repository
Other
81 stars 23 forks source link

Error: Cannot export model ArithmeticException: / by zero #53

Closed franssauermann closed 5 years ago

franssauermann commented 5 years ago

I get the error: Cannot export model ArithmeticException: / by zero when pressing the Export button.

I use a Mac 10.14.1 and have loaded the v2.1.4 JAR file into the Archi 4.2.0 application package folder for plugins.

Here is the DatabasePlugin.log

2018-11-09 15:06:19 ERROR 38:DBExporter - Cannot export model java.lang.ArithmeticException: / by zero at org.archicontribs.database.GUI.DBGui.(DBGui.java:241) ... It seems this line of code is causing problems int scaleFactor = Toolkit.getDefaultToolkit().getScreenResolution() / this.dialog.getDisplay().getDPI().x; this.dialog.setLocation(((Toolkit.getDefaultToolkit().getScreenSize().width / scaleFactor) - this.dialog.getSize().x)

Im assuming that scaleFactor is getting set to 0?

herve91 commented 5 years ago

Yes, you're right. I do not know why but I added some tests to avoid the exception.

It will be fixed in the next release. Thanks for your help.

Best regards Hervé