Specific case for school_ability and mastery_ability on drop

This commit is contained in:
Vlyan
2021-01-02 14:09:34 +01:00
parent 331872e84f
commit 5afb766ee2
2 changed files with 15 additions and 6 deletions

View File

@@ -55,7 +55,11 @@ export class HelpersL5r5e {
* Return the target object on a drag n drop event, or null if not found
*/
static async getDragnDropTargetObject(event) {
const data = JSON.parse(event.dataTransfer.getData("text/plain"));
const json = event.dataTransfer.getData("text/plain");
if (!json) {
return null;
}
const data = JSON.parse(json);
return await HelpersL5r5e.getObjectGameOrPack(data.id, data.type, data.pack);
}