Crash opening file with two empty object IDs

Observed on Inkscape 1.0beta1 (32d4812, 2019-09-19), macOS 10.14. [Not observed on Inkscape 0.92.2.]

Inkscape crashes when opening an SVG file that contains two or more objects that have id=""

Example file attached. The total contents of this example file are:

<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" 
    xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    width="1000px" height="1000px"  >

<line id="" x1="0" y1="0" x2="800" y2="800" stroke-width="5" stroke="#000000" />
<line id="" x1="800" y1="0" x2="0" y2="800" stroke-width="5" stroke="#000000" />
</svg>

Some additional observations:

  1. If the objects are declared with unique IDs (as below), the file will open correctly.
<line id="line1" x1="0" y1="0" x2="800" y2="800" stroke-width="5" stroke="#000000" />
<line id="line2" x1="800" y1="0" x2="0" y2="800" stroke-width="5" stroke="#000000" />
  1. If the objects are declared without IDs (as below), the file will open correctly.
<line x1="0" y1="0" x2="800" y2="800" stroke-width="5" stroke="#000000" />
<line x1="800" y1="0" x2="0" y2="800" stroke-width="5" stroke="#000000" />
  1. If only one object is declared without an ID (as below), the file will open correctly.
<line id="" x1="0" y1="0" x2="800" y2="800" stroke-width="5" stroke="#000000" />
<line id="line2" x1="800" y1="0" x2="0" y2="800" stroke-width="5" stroke="#000000" />
  1. If both objects are declared with the same non-unique ID (as below), the file will open correctly.
<line id="line1" x1="0" y1="0" x2="800" y2="800" stroke-width="5" stroke="#000000" />
<line id="line1" x1="800" y1="0" x2="0" y2="800" stroke-width="5" stroke="#000000" />

test3.svg

Edited Oct 15, 2019 by Windell Oskay
Assignee Loading
Time tracking Loading