summaryrefslogtreecommitdiff
path: root/client/js/controllers/post_main_controller.js
diff options
context:
space:
mode:
authorEva <evauwu@riseup.net>2023-05-23 18:26:02 +0200
committerEva <evauwu@riseup.net>2024-03-28 13:31:48 +0100
commitb72e81850dcb898cb53dbe4ff2788acabe5472ba (patch)
tree52862b0539f3df7d2988d79c159e7d2c0323275c /client/js/controllers/post_main_controller.js
parent782f0690318d21e9e09ac88984afc59a1812b888 (diff)
client: add null checks
Diffstat (limited to 'client/js/controllers/post_main_controller.js')
-rw-r--r--client/js/controllers/post_main_controller.js12
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(