Skip to content

Commit

Permalink
Convert input to RecordValue if possible.
Browse files Browse the repository at this point in the history
  • Loading branch information
lemmy committed Nov 20, 2019
1 parent 403b14e commit d8494ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/SVG.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ private SVG() {
* innerText |-> <string> ]
*/
public static Value SVGElemToString(Value elem) throws Exception {
if (!(elem instanceof RecordValue)) {
if (!(elem instanceof RecordValue) || elem.toRcd() == null) {
throw new Exception(
"An SVG element must be a record. Value given is of type: " + elem.getClass().toString());
"An SVG element must be a record. Value given is of type: " + elem.getClass().getName());
}

RecordValue frv = (RecordValue) elem;
RecordValue frv = (RecordValue) elem.toRcd();

// Get 'name'.
StringValue nameVal = (StringValue) frv.apply(new StringValue("name"), 0);
Expand Down

0 comments on commit d8494ba

Please sign in to comment.