diff options
| author | Neo <50623835+neobooru@users.noreply.github.com> | 2024-04-27 21:23:16 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-27 21:23:16 +0200 |
| commit | d102578b544226207fac055d0c6ed1a45a12e471 (patch) | |
| tree | 035a9b74017e8db2c52b924cea0d90f470d96496 /client/js/controllers/post_main_controller.js | |
| parent | 6edb25d87b24db087fdf6496552a31979a7c2ec8 (diff) | |
| parent | b72e81850dcb898cb53dbe4ff2788acabe5472ba (diff) | |
Merge pull request #647 from po5/null-checks
client: add null checks
Diffstat (limited to 'client/js/controllers/post_main_controller.js')
| -rw-r--r-- | client/js/controllers/post_main_controller.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/client/js/controllers/post_main_controller.js b/client/js/controllers/post_main_controller.js index 95cfdb5..bd33812 100644 --- a/client/js/controllers/post_main_controller.js +++ b/client/js/controllers/post_main_controller.js @@ -169,22 +169,22 @@ class PostMainController extends BasePostController { this._view.sidebarControl.disableForm(); this._view.sidebarControl.clearMessages(); const post = e.detail.post; - if (e.detail.safety !== undefined) { + if (e.detail.safety !== undefined && e.detail.safety !== null) { post.safety = e.detail.safety; } - if (e.detail.flags !== undefined) { + if (e.detail.flags !== undefined && e.detail.flags !== null) { post.flags = e.detail.flags; } - if (e.detail.relations !== undefined) { + if (e.detail.relations !== undefined && e.detail.relations !== null) { post.relations = e.detail.relations; } - if (e.detail.content !== undefined) { + if (e.detail.content !== undefined && e.detail.content !== null) { post.newContent = e.detail.content; } - if (e.detail.thumbnail !== undefined) { + if (e.detail.thumbnail !== undefined && e.detail.thumbnail !== null) { post.newThumbnail = e.detail.thumbnail; } - if (e.detail.source !== undefined) { + if (e.detail.source !== undefined && e.detail.source !== null) { post.source = e.detail.source; } post.save().then( |