artemtech / inkscape-gradient-saver

Inkscape's extension for saving gradient for your next project
GNU General Public License v3.0
20 stars 3 forks source link

Gradient in Stroke causing an error #6

Open meetdilip opened 2 years ago

meetdilip commented 2 years ago

First of all, thanks for the great extension.

I know it is probably not relevant because I use Inkscape 1.2 (1:1.2.1+202207142221+cd75a1ee6d) on Ubuntu 22.04

The extension throws an error when there is a gradient in stroke, no matter what. Tested for both text and a rectangle.

Error message was

/usr/lib/python3/dist-packages/apport/report.py:13: DeprecationWarning: the imp module is deprecated in favour of importlib and slated for removal in Python 3.12; see the module's documentation for alternative uses
  import fnmatch, glob, traceback, errno, sys, atexit, locale, imp, stat
Traceback (most recent call last):
  File "/home/pcone/.config/inkscape/extensions/gradient_saver/gradient_saver.py", line 395, in <module>
    e.run()
  File "/usr/share/inkscape/extensions/inkex/base.py", line 231, in run
    self.save_raw(self.effect())
  File "/home/pcone/.config/inkscape/extensions/gradient_saver/gradient_saver.py", line 383, in effect
    self.doc_selected_gradients = self.get_selected_gradients_data()
  File "/home/pcone/.config/inkscape/extensions/gradient_saver/gradient_saver.py", line 358, in get_selected_gradients_data
    stroke = style("stroke")[5:-1] if "url" in style.get("stroke") else "None"
TypeError: 'NoneType' object is not subscriptable